ENH: numba apply supports positional arguments passed as **kwargs
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [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 if fixing a bug or adding a new feature.

@lithomas1


This is a followup PR that enhances `prepare_function_arguments` introduced in #58767. `prepare_function_arguments` helps to move `**kwargs` to `*args` where possible using `inspect.Signature`.  And now it's also more reasonable to move kwargs check from `get_jit_arguments` to `prepare_function_arguments`.

ref: https://github.com/pandas-dev/pandas/pull/58767#issuecomment-2131310623
> We can also extend `prepare_function_arguments` by adding a option: `num_required_args`, so that all the numba functions' args & kwargs stuff can be handled by this function, instead of in `get_jit_arguments` . For example in groupby, we have `numba_func(group, group_index, *args)`, in this case `num_required_args = 2`:
> 
> https://github.com/pandas-dev/pandas/blob/3b48b17e52f3f3837b9ba8551c932f44633b5ff8/pandas/core/groupby/numba_.py#L102-L120

There are several places where the usage of `get_jit_arguments` is updated and `prepare_function_arguments` is added : `groupby.agg`, `groupby.transform`, `rolling.apply` and `df.apply`.



This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this. > This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.

Please do not mark as stale, this PR is ready for review. @auderson - can you merge main. Failures seem unrelated: `FAILED pandas/tests/io/test_spss.py::test_spss_metadata - AssertionError`. @lithomas1 - friendly ping. Also I find there are some methods like `RollingGroupby.apply` which are also impacted by the changes to `RollingAndExpandingMixin.apply`. So I added more tests to cover these methods in `tests/window/test_numba`. Thanks @auderson 