Take *n* bytes from the bytearray and return them as a bytes object. n Bytes to take, negative indexes from end. None indicates all bytes.
The official docs include a CPython implementation detail for this entry.
builtins/bytearray.take_bytes
bytearray.take_bytes