(#4506) Revert e161cbc, which causes 'undefined allocator for Proc' errors

I'm not familiar with *why* this causes damaged YAML output, but reverting this performance optimization commit repairs the issue for me with 3.0.0, 3.2.4, and 3.3.0-rc.