Workaround for issue #14125.

Explicitly set __env__ and friends for python file templates.