Check out `org-export-filter-src-block-functions'. It shouldn't be too hard to add a custom filter to that list which may be used to process all code block bodies during latex export.
Best, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D