This is kind of an alternative to D50586. Instead of modifying the parsed string in the middle of parsing, we "remangle" the (possibly modified name" into a new string.
This isn't complete yet (I've needed to modify some parts of the AST construction to preserve enough information for remangling, but I haven't done this for all nodes), and it needs a lot of cleaning up. In particular, it does not yet expose any way to actually modify the parsed AST.
However, I am putting it out here, to show a possibly cleaner (and definitely more powerful) alternative to the mentioned patch.