Maybe some basic stuff like usart, i2c works fine. But the the deeper you dig into the specialties the more you will have problems.
And STM32s and expensive? Maybe if you buy them from Digikey or Mouser. With the right distributor they are dirt cheap.
Porting stuff to another microcontroller would be easy as we are not using too proprietary features... as long the uC has SPI/I2C and a bunch of timers the embedded developers will be happy. Thanks to Zephyr.
That only gets you proper support for a couple vendors (Nordic, ST), everything else is a nightmare. Even with better-supported vendors, there are whole swaths of things that aren't properly supported and you need to directly call code from underlying vendor SDK to make things work. That bodge makes the whole project non-portable. Even some simple things like ADC DMA on ST F1 series..
Sometimes stuff is missing. But that's implemented and upstreamed quickly.