It would be hard to implement in a way that works across the Fediverse. You can change your display name easily, but your handle is part of the unique identifier for your account and posts, so changing it would break things on remote instances that use the old handle to locate resources.
However, you can do an account migration - essentially, you make a new account and turn your old one into a static redirect. It's a bit cumbersome, but it does the job, and it's less painful if you're still relatively new and have less investment in the old account. There's a writeup [here](https://docs.joinmastodon.org/user/moving/#migration) which you can follow if you want to start this process.
@khird @freemo Ah okay thanks for the detailed response. I already knew you could migrate your mastodon account to a different instance and I understand now why it would break things :)