Alas, this tail recursion is not optimized. It still blows the stack after ~250 iterations. That may be okay in some cases, but it’s orders of magnitude below what we need.
This is one of those cases where perhaps Ansible isn’t the right tool for the job.
Thanks anyway.