What's the correct or at least most used alternative? Example:
He didn't know how to reply. Better veer off (the) topic.
A native English speaker told me to remove the "the" but I also found instances on Google where they include the "off."
The issue here is confusion about how to parse the sentence.
Off-topic (or off topic) is a compound noun and your editor likely thinks that this is the word you are using. When using a compound noun, you wouldn’t insert an article (or any adjective) in between the “off” and the “topic” parts. “Off topic” despite being orthographically two words is lexicographically one word.
However, “off” could also be considered as being paired with “veer,” which seems to be your intention. In this case you can certainly say “veer off the topic” though I think that “veer off of the topic” is more natural.