PEP8/PEP20: use kwargs.get instead of one line if/else

I was poking around in the transport code thinking about an idea and
noticed this simplification.
Misc cleanup