You’re wrong about being able to trust standard anchor links- you can’t. You can intercept the click using an onclick handler and redirect the user to wherever you want.
Viglink and Skimlink do this for affiliate programs, which is somewhat legitimate.