System Integrity Protection breaks DYLD_LIBRARY_PATH for python scripts
Note: This only works in the Z shell (zsh).

Although I would normally say this is a bad idea, I can't see anything wrong with doing this with env, which is a pretty harmless command. Try copying env into /usr/local/bin and replacing /usr/bin/env python in the shebang with just env python (without the absolute path). Assuming you have /usr/local/bin somewhere near the beginning of your PATH variable on OS X, it'll pick up the relocated one, which will no longer be covered under SIP. That shebang will also work on Linux.