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"
the macOS run failed because it timed out
![image](https://user-images.githubusercontent.com/6618166/121413816-10aa2300-c934-11eb-849d-01e73498152e.png)
 thanks @twoertwein  It _seems_ that the mac build started failing with this PR (it's failing now on master consistently since this PR, and I didn't notice any change in versions of dependencies in the build environment that might otherwise explain it).

Above it was mentioned that the Mac build timed out, but the last commit actually has the failing build without time out. 

It's a bit strange (and didn't look further in detail, just reporting here), the actual tests seems to pass (pytest prints the end result), but then there is:

```
ci/run_tests.sh: line 31:  2533 Segmentation fault: 11  sh -c "$PYTEST_CMD"
##[error]Bash exited with code '139'.
```

Although nothing in the diff of this PR would explain a new failure, though There is also a

```
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "pyarrow/types.pxi", line 2638, in pyarrow.lib._unregister_py_extension_types
SystemError: unregister_extension_type() method: bad call flags
```

in the output Noticed there is already an issue about it -> https://github.com/pandas-dev/pandas/issues/41937