PERF: Check identity first before comparing the objects
 - [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them

This is a regeression in #41952. Checking the identity first avoids long comparison of e.g. tuples - checking the id first is also how `PyObject_RichCompareBool(a, b, Py_EQ)` works.

Here are results from asv:

```
       before           after         ratio
     [1ff6970c]       [b8285515]
-      11.0±0.1ms      7.09±0.06ms     0.64  algos.isin.IsInWithLongTupples.time_isin

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.

```
