cache the tostring of ASTs

the JIT will call it repeatedly