The law doesn’t need to be international, only one large enough market needs to do it. The market has to matter enough that the manufacturers won’t just say “screw them” and pull out of it. Then the mechanics are there and everyone benefits even those who live where there is no such law.
Manufacturers already sell unlockable/non-unlockable devices per-market. Not having this be international means they’ll just lock the device where they can.