I believe there's a proof of concept of this already floating around.
But it would be nice to follow up T145604: RFC: Future of magic links by not just setting the configuration var to false on WMF wikis but actually pulling support for magic links out of core and moving it to an extension.
I believe there's a proof of concept of this already floating around for the legacy parser, using an existing hook.
It would be a useful demonstration of the Parsoid extension API's DOM post-processing/pre-processing stages as well, and so may be worth putting on a roadmap as part of T248342: Parsoid Extension API for MediaWiki 1.36. Not committing to this, of course.