Thanks a lot.
I have applied your patch. Unfortunately, that's still not the main bottleneck in Autoconf. It does improve your issue, but for instance it has no impact on the fileutils nor Autoconf's test suite. I am still deeply convinced we need more assistance from M4, especially to maintain the call stack. Thanks!