BUG: read-only values in cython funcs
- [x] closes #34857
- [x] closes #37264
- [x] closes #37312
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

@simonjayhawkins this might be worth backporting > @simonjayhawkins this might be worth backporting

sure. will wait for #37628 to be merged to avoid merge conflicts in release notes. `to_datetime` not works when `unit` set,
```python
import pandas as pd
import numpy as np

a = np.array([1,2,3])
a.setflags(write=False)
pd.to_datetime(a, utc=True, unit='s')
```
This would call `tslib.array_with_unit_to_datetime` eventually.