python: fix sitecustomize.py

Fixes #26377.
Fixes #28001.
python3: bring sitecustomize in sync with python2