Use a function to avoid polluting/overwriting envvars
Use a function to avoid polluting/overwriting envvars

Turns out some other script of ours that `source`s this also uses the same idiom for figuring out the location of the script. Same names, too! Making the variables readonly revealed this problem.
ariovistus/pyd,ariovistus/pyd,ariovistus/pyd