pycompat: prevent encoding or decoding values if not required
pycompat.py has functions strurl and bytesurl which decodes and encodes the url
passed on Python 3 respectively. In some cases, strurl gets a url which is
already str and bytesurl gets a url which is already bytes. Let's prevent
encoding or decoding the values again if not required.
Differential Revision: https://phab.mercurial-scm.org/D2472