The GRAMPSHOME environment variable can be used to keep data of different version of Gramps segregated.
But the CLI command wiki page only has a single paragraph about it. It appears to be written for Linux.
What about Windoze (not trying to be negative, just trying to differentiate from ‘windows’ as GUI elements) and macOS?
https://www.gramps-project.org/wiki/index.php?title=GRAMPSHOME