CLN: use getvalue() instead of seek(0)+read()
`BytesIO`'s `getvalue()` is the same as `seek(0)` followed by `read()` if the buffer is not used in any other place (`getvalue` doesn't change the position within the buffer). getvalue is slightly faster then seek+read.