People can usually unlock the carrier on their own. Many phones (or at least every phone I’ve ever gotten from T-Mobile) even come pre-installed with a carrier unlocking app. It’s just not automatic, and certain conditions need to be met.
People may also sometimes be able to buy phones already unlocked directly from the manufacturer if they want to. (Whether or not they’re able to do this depends on the manufacturer.)
I knew I’d heard of a site that did this already. Couldn’t remember the name, though. Thanks!