def ReadTag(buffer, pos):
start = pos<EOL>while six.indexbytes(buffer, pos) & <NUM_LIT>:<EOL><INDENT>pos += <NUM_LIT:1><EOL><DEDENT>pos += <NUM_LIT:1><EOL>return (buffer[start:pos], pos)<EOL>
Read a tag from the buffer, and return a (tag_bytes, new_pos) tuple.

    We return the raw bytes of the tag rather than decoding them.  The raw
    bytes can then be used to look up the proper decoder.  This effectively allows
    us to trade some work that would be done in pure-python (decoding a varint)
    for work that is done in C (searching for a byte string in a hash table).
    In a low-level language it would be much cheaper to decode the varint and
    use that, but not in Python.