[3.13] gh-126654: Fix crash in several functions in `_interpreters` module (GH-126678) (#126681)

gh-126654: Fix crash in several functions in `_interpreters` module (GH-126678)
(cherry picked from commit 9fc2808eaf4e74a9f52f44d20a7d1110bd949d41)

Co-authored-by: sobolevn <mail@sobolevn.me>
3 files changed