Description
In #64385 this functions was converted to the Argument Clinic. Unfortunately, the function signature was "corrupted", probably to prevent showing "magic number" 2.718281828459045 in the function docstring, and this has a noticeable speed impact (~2x regression). In the current main:
$ ./python -m timeit -s 'from math import log' 'log(1.1)'
1000000 loops, best of 5: 341 nsec per loop
$ ./python -m timeit -s 'from math import log' 'log(1.1, 3.2)'
500000 loops, best of 5: 576 nsec per loop
while without the AC stuff (but with METH_FASTCALL):
$ ./python -m timeit -s 'from math import log' 'log(1.1)'
2000000 loops, best of 5: 171 nsec per loop
$ ./python -m timeit -s 'from math import log' 'log(1.1, 3.2)'
1000000 loops, best of 5: 346 nsec per loop
(A different "corruption" was used in the cmath.log, without noticeable speed regression. Unfortunately, it can't be adapted for the math module.)
Given that with the current "state of art" for the AC and the inspect module it's impossible to represent the math.log() correctly (see #89381) - I think it does make sense to revert the AC patch for this function. BTW, the math module has several other functions, that are not converted to the AC, e.g. due to performance reasons (like hypot(), see #30312).