Situationally removing trailing slashes in URLs (yes, I read every thread)

I’m in the same situation, but with a site with around 100k pages. Adding trailing slashes to all URLs will seriously hamper the migration. I don’t care about “best practices” – I just need to replicate the old site EXACTLY, but now with Hugo. And the old site nowhere uses trailing slashes. In fact, a page with trailing slash will 301 to remove that slash.

@nickjanetakis would you please share how you did this?