MAINT: Abstract index helpers in pxi.in file
Title is self-explanatory.  xref #14937.
## [Current coverage](https://codecov.io/gh/pandas-dev/pandas/pull/14989?src=pr) is 84.66% (diff: 100%)
> Merging [#14989](https://codecov.io/gh/pandas-dev/pandas/pull/14989?src=pr) into [master](https://codecov.io/gh/pandas-dev/pandas/branch/master?src=pr) will not change coverage

```diff
@@             master     #14989   diff @@
==========================================
  Files           144        144          
  Lines         51056      51056          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          43225      43225          
  Misses         7831       7831          
  Partials          0          0          
```

> Powered by [Codecov](https://codecov.io?src=pr). Last update [aba7d25...6711b97](https://codecov.io/gh/pandas-dev/pandas/compare/aba7d255a165bbc221be106839c59a876655c0c2...6711b9771a48419689a8fc77ba0b47aaecc67430?src=pr) thanks!