CLN refactor rest of core
Some refactorings found by Sourcery https://sourcery.ai/

I've removed the ones of the kind
```diff
- if param:
-     var = a
- else:
-     var = b
+ var = a if param else b
```
can you merge master ping on green I still need to address https://github.com/pandas-dev/pandas/pull/37586#discussion_r519926657 , will ping when it's ready moving off 1.2 until fixed up
 Sure, no problem, though I believe I've responded to the review comments, I think it should be ready now @MarcoGorelli can you rebase and see if you can get passing ok this looks fine, but a ci /checks is failing. ping on greenish thanks @MarcoGorelli this is a nice cleanup. in the future pls do these types of changes in smaller batches.