def bytes_to_int(data):
    """Convert a bytes/str/list to int.
    
    >>> bytes_to_int(b"a0")
    24880
        
    Passed a list with null bytes:
        
    >>> bytes_to_int([97, 48])
    24880

    Passed a string:
    
    >>> bytes_to_int("a")
    97
    """
    # note big-endian is the standard network byte order
    try:
        return int.from_bytes(data, byteorder='big')
    except:
        # PYTHON2 HACK...
        if type(data) == str:
            return sum(ord(c) << (i * 8) for i, c in enumerate(data[::-1]))
        else:
            return sum(c << (i * 8) for i, c in enumerate(data[::-1]))