BUG: inverting object dtype containing bools
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [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
- [ ] 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.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Motivation: when trying to deprecate the inplace keyword in `where` in favor of using `mask` with a flipped condition, i found some tests failed because we pass a object-dtype frame of bools and inverting that frame gives weird results.  This is because the python behavior is weird:

```
>>> ~True
-2
>>> ~False
-1
```

This has the impact that if we have a bool-dtype Series and invert it, the behavior doesn't pointwise-match the object-dtype behavior.  This PR changes the object-dtype behavior to what I think is more reasonable. 

If someone were to complain about this diverging from the python/numpy behavior, I'd understand.

Was there an existing issue about this? I found https://github.com/pandas-dev/pandas/issues/51567 but not sure if this case was also specifically discussed somewhere > Was there an existing issue about this?

I dont think we have one, but there is https://github.com/numpy/numpy/issues/23926, also i think i mentioned it on slack at some point Can we raise/do nothing instead to follow future Python versions? Python 3.12 deprecated this.

https://docs.python.org/3.12/whatsnew/3.12.html#:~:text=The%20bitwise%20inversion,gh%2D103487.) I wasnt aware of that python deprecation.  That makes doing nothing more attractive.  But then that'll mean for bool dtype the vector behavior wont match the pointwise (raising) behavior.  Deprecating `~` for bool dtype would seem really weird though.  do we just live with the difference?

(note to self: open an issue about deprecating Timestamp utcfromtimestamp, utcnow as they are deprecated in the stdlib)  Hm numpy should also be hitting the same issue. I'm curious what they think about the issue.

cc @seberg We don't have object dtype as often, especially for bools.  So I think we just say that this is awkward if you have Python bools and do whatever Python does.  It is nice that Python deprecates this.

NumPy doesn't do indexing with object dtype, we would convert to bool or integer first. This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.