Automatically escape a string for shell expansions!
$ alias shellescape="python -c 'import sys,subprocess;sys.stdout.write(subprocess.list2cmdline([sys.stdin.read()]))'"
$ echo '{"username":"$MYUSERNAME","password","$MYPASSWORD"}' | shellescape
{\"username\":\"$MYUSERNAME\",\"password\",\"$MYPASSWORD\"}