TYP: to_csv accepts IO[bytes] and fix FilePathOrBuffer
Two small typing fixes:

- `to_csv` accepts `IO[bytes]` (replace `FilePathOrBuffer[str]` with `FilePathOrBuffer[AnyStr]`)
- pyright was not able to parse `FilePathOrBuffer` because the unconstrained TypeVar `pandas._typing.T` was used when the constrained TyepVar `typing.AnyStr` should have been used: Could not specialize type "Buffer[AnyStr@Buffer]"   Type "T@FileOrBuffer" is incompatible with constrained type variable "AnyStr"