gh-96538: Move some type-checking out of bisect.bisect() loops (GH-96539)

2 files changed