I explored some options but this was by far the simplest/most efficient. The stack var optimization that prevented us from needing multiple stack vars when invoking helpers is no longer available to us since invoking a helper means invoking its 0-N subexpressions that would also need stack vars. It's really hard to explain this bit of it but I'm fairly certain this is as simple/efficient as it's gonna get, and I think you're correct about gzip.