Ok, I see SB-Prolog had unnumbervars/3:
- unnumbervars(+Term, +FirstN, ?Copy)
This predicate is a partial inverse of predicate numbervars/3. It creates a copy of Term in which all subterms of the form '$VAR'(<int>) where <int> is not less than FirstN are uniformly replaced by variables. '$VAR'' subterms with the same integer are replaced by the same variable. Also a version unnumbervars/2 is provided which calls unnumbervars/3 with the second parameter set to 0.
https://www3.cs.stonybrook.edu/~sbprolog/manual2/node6.html
Only it has a different signature. But it is a start!