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.
Merge pull request #12318 from borgstrom/develop

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