oh my hecking gosh...
there's a feature I have been wishing pandoc has for years – some way of pre-processing the input with my own rules, so I can add my own simplifications for specific documents.
it turns out.... it's had this feature the whole time: https://pandoc.org/filters.html