I don’t think that support of wp.me links is a theme responsibility – almost certainly not allowed by wp.org.
I don’t know about wordpress.org sites, but it does seem that wordpress.com sites have support for that built into the block and classic editors. Perhaps there is a plug to add that to wordpress.org sites.
I know if you use the image caching support from JetPack, add the links are auto-patched, so one would hope they might have some similar capability for wp.me links.