yes, this will affect sys.path anywhere .... you can save it and restore it later
import sys _opath = sys.path[:]
you can convert it to a tuple rather than a list ... depending on how they add to the path, which may work, but it may break some of your imported modules if they change paths
you can also access
os.environ["PYTHONPATH"]
source share