BUG: DataFrame slice selection treated as hashable in Python 3.12 #57500
- [X] closes #57500
- [X] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [X] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [X] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions. _(Not applicable)_
- [X] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

My commits are out of order, but I confirmed the unit test behaves correctly by backing out the bug fix and running my unit test on 3.12. As expected, it failed. Thanks @tehunter 