Google has a great aid to reduce the attack surface: https://github.com/google-research/arxiv-latex-cleaner

I do this by hand. In the whole process, cleaning up the TeX before submission is a small step. And I like to keep some comments, like explaining how some Tikz figures are made. Might help someone some day.

I use this before submission and recommend others do too. If ai was in charge of arXiv Id have it integrated as an optional part of the submission process.