function: Only get function name if we actually warn
Getting the function name for logging a warning/error message using format_function_name() is expensive and shows up with quite a few percent in the profiler. Luckily, we can completely get rid of that overhead by only getting the function name in case we actually have to warn. To do that, check the number of arguments ourselves instead of using args.requireAtLeast() and then move the call to format_function_name() into the if-conditions of those checks.
Showing with 7 additions and 3 deletions