update fix ignored sort in api.py and add test
- [x] closes #43375 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry

As mentioned in the ticket, the function `api.union_indexes` does not handle the sort parameter. I added support for it, but we explicitly check that sort can only take the values `False` and `None` in [here](https://github.com/pandas-dev/pandas/blob/62d1f5c0fb16b6990aceabb8491d61de63cd042a/pandas/core/indexes/base.py#L2898)
Hello @CloseChoice! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:











There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2021-10-08 14:56:28 UTC > might have to adjust some other tests

Can we just adjust other test results? That would be technically be a breaking change, wouldn't it? my point about adjusting test is that this case might be only internal or not - will have to see @github-actions pre-commit @github-actions pre-commit @jreback all lights on green. I also added a whatsnew entry. thanks @CloseChoice 