I can’t confirm right now if it works today, but I remember previously inserting a new SIM and having Apple ask me if I want to update my iMessage number to the new number? Actually, never mind, easier than that. All you need is unlocked access to a device that already has 2FA, it seems: https://support.apple.com/en-ca/guide/iphone/iphd709a3c46/io... (see section to add or remove a new phone number)
Feels like there’s a missing password prompt there. And maybe confirmation on a second device, if you have one.