If `map` accepted a tuple for its first argument, things like this: 

    stdout, stderr = map(str.strip, map(bytes.decode, popen.communicate()))

Could become this: 

    stdout, stderr = map((bytes.decode, str.strip), popen.communicate())