py: Make int.from_bytes a classmethod; support arbitrary length buf.