ENH add *args support for numba apply
- [ ] closes #58712
- [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.

added `*args` to `nb_looper()`. 
use `get_jit_arguments()` to disallow `**kwargs` in raw + numba engine.
@lithomas1 
I notice that `*args` support for raw=False + numba engine can be also added, should I open a another PR or just put them together? > @lithomas1 I notice that `*args` support for raw=False + numba engine can be also added, should I open a another PR or just put them together?

If it's not too involved to add support there, you're welcome to put it in the same PR. 

Thanks for the quick PR btw. It's all done. Could you take a look when you have time? Does this also handle **kwargs by e.g. passing them as *args?

It might be worth exploring that.

This LGTM otherwise. That's a good point, I'll have a try later when I have time. BTW, since this PR was labeled as enhancement, should I move it to the enhancement section in whatsnew? @lithomas1 
Hi, I added an util function as you suggested. It would be nice if you spare some time to have a look at it. 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 > 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

Good idea.

Do you mind doing this in a separate PR after this?  > Good idea.
> 
> Do you mind doing this in a separate PR after this?

Sure, I'll do that after I finish this PR. Looks all green :) @lithomas1  @lithomas1  Hi, if you may have time, please take a look so that I will start the other PR which enhances `prepare_function_arguments`. Thanks @auderson 