I would probably either do
```
        protocol = "http"
        if mblogin and host=='musicbrainz.org' and port==80:
            # mblogin implies call to musicbrainz which supports SSL so switch port to 443 for actual call
            protocol = "https"
            port = 443
        log.debug("%s %s://%s:%d%s", method, protocol, host, port, path)
```
or
```
        if mblogin and host=='musicbrainz.org' and port==80:
            # mblogin implies call to musicbrainz which supports SSL so switch port to 443 for actual call
            ssl = True
            port = 443
        if ssl:
          url = https://...
        else:
          url = http://...
        log.debug("%s %s", method, url)
```

Having a variable `ssl` be either "s" or "" seems unintuitive to me. Variables should be self-descriptive as to as large an extent as possible, IMHO.

Other than that small nitpick: +1