Add ability to configure recursion limit.

Fixes #19318.
Kill dead code
Stop masking overflow and propagate it out more aggressively; also improve error reporting to suggest to user how to fix.