allow recursion depth to be specified (closes #19628)

Patch from Claudiu Popa.
Idle ColorDelegator: remove special case code for 'as' in import statements.
'As' became a full keyword when with statements were added in 2.5/2.6.
Merge with 3.4