Hence the interrobang in the title. I hope that someone smarter than me can alleviate those two issues.
Python isn't my strongest language, but there will be other ways to launch an external process while forwarding STDERR / STDOUT streams in real time. Maybe instead of forking a shell, run the command as a process. You can still execute from within a shell using -c flag, eg
$ bash -c 'export a=$(echo "hello world"); echo $a'
hello world
$ echo $a # demonstrates that the envs aren't passed backwards
$
If you do this then you need to be careful about your quotes / escaping. But it would still be less work than reinventing a Bash script parser.