in reply to hiding passwords

Who needs a core file?

How about in the environment that launches the script (this is for Linux):
ulimit -c 0

- limits core files to 0 bytes, hence nothing to snoop on.