Fix code triggering superfluous-parens pylint messages
- [ ] Contributes to #48855
- [X] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

There were several locations where superfluous parentheses were being used to clarify the operator precedence in potentially ambiguous situations. Parentheses were removed and the code was refactored to add clarity where relevant. 

This code structure was a little confusing:
```
        assert not (left == right)
        assert left != right
```
I decided to remove the first line altogether, since it seems unnecessary. If it does serve a purpose, I can add it back. 

A duplicate `"too-many-locals"` was also removed from 'pyproject.toml'.
Thanks @Leviob 