Just to report that I indeed found a memory leak in the script execution handler. Relatively minor leak, but in tight loops as in the samples above, it can quickly lead to rather dramatic effects... Beta 2 of 4.12 will include a fix for this particular issue.