BUG: This fixes #55009 (`raw=True` caused `apply` method of `DataFrame` to ignore passed arguments)
This should fix #55009. I documented the fix and also added some code to the tests that should pick it up next time.

Unfortunately, I was not able to run the tests manually yet with this error:

```
ImportError while loading conftest.
__init__.py:46: in <module>
    from pandas.core.api import (
core/api.py:1: in <module>
    from pandas._libs import (
_libs/__init__.py:16: in <module>
    import pandas._libs.pandas_parser  # noqa: E501 # isort: skip # type: ignore[reportUnusedImport]
E   ModuleNotFoundError: No module named 'pandas._libs.pandas_parser'
```

I probably do not have something properly installed. So let me know if I should run them in addition to what is done on the CI pipelines.

## Checklist

- [x] closes #55009
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file

pre-commit.ci autofix Thanks @martin-sicho  @​mroeschke Hi, could you please consider making this fix available sooner, perhaps in the next patch release? I believe that using `.apply` with `raw=True` is a commonly used pattern. If this fix is to be included in version 2.2 which is scheduled for December, it could potentially affect the usability of pandas 2.1.x for some users.