COMPAT: cython str-to-int can raise a ValueError on non-CPython
closes #16336
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=h1) Report
> Merging [#16563](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/03d44f3dd0ffd55d7538b67466cf4d3899ceac27?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/16563/graphs/tree.svg?height=150&width=650&token=eZ4WkYLtcO&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #16563   +/-   ##
=======================================
  Coverage   90.75%   90.75%           
=======================================
  Files         161      161           
  Lines       51074    51074           
=======================================
  Hits        46353    46353           
  Misses       4721     4721
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.59% <100%> (ø)` | :arrow_up: |
| #single | `40.16% <100%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.66% <ø> (ø)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `95.74% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=footer). Last update [03d44f3...1cb3a1d](https://codecov.io/gh/pandas-dev/pandas/pull/16563?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
 thanks!