A solution to this is apptainer: you configure it to not see any of the host files by default, and mount the repo you want to work on at runtime.
Question, out of curiosity, do you know how User and Permissions work?
Question, out of curiosity, do you know how User and Permissions work?