Ever since Pis stopped being cheap, I've been looking at projects with the STM32 in mind over an ESP32, but then again I don't care too much about having BT/WiFi. I haven't really gone shopping for parts in a while: is there much of a difference between the two these days?
I don't really see them in the same niche; I like the ESP32 as a general purpose, powerful, not-on-batteries option, while ST gives me lots of options so I can find a microcontroller that fits the specific project needs well without a bunch of extra stuff to worry about turning off. In general I think you have a lot more control with STM32 than you do with ESP32, not just in picking your parts but in fine control of the microcontroller. But, I'm not an expert in either, I just fool around.