I live in the EU and have never encountered a carrier locked phone. It's quite an amusing concept, and the first carrier to come up with it must truly have been evil.
I live in the EU too (France), and any phone you buy directly from a carrier (generally heavily discounted, but tied to a more expensive plan) is carrier-locked, and can only be unlocked after a set amount of time has passed, or earlier by paying a fee (regulated by the EU if my memory serves me well).
Perhaps it's because I was less financially literate in the past, but I remember that as being the only way in the 2000s. There might have been laws passed to limit that practice and its abuses.
The smart solution, provided you have enough money, is to buy the phone elsewhere, and take a plan without a phone. It's always less expensive in the long term.
in Germany, the Telco's gave up locking the phones in 2017. Because it was to expensive. I can not remember if it was a hard lock - as in any other sim card is blocked or just their additions to the OS. bought a phone in 2017/early 2018 - Xperia 10, where on the boot screen a Deutsche Telekom logo appears but otherwise the OS unaffected by vendor edits/additions. But updates are really slow since they go through Telekom instead of directly from sony which is already slow.
Funny. As I remember from the times of early GSM, that carrier lock was the default, because subsidized by them in exchange for long term contracts like 2 years. Otherwise you had to pay much more intitially, but it could make sense to calculate this, instead of blindly trusting the advertisements.
Isn't it about trade-offs? As long as my carrier provides my family with free iPhones, I will bear the inconvenience of requesting device unlock every few years. It takes 2 minutes to unlock it. If I am to pay full price for the device I will not get a locked one.