I'd like to be able to allocate just enough space for my output buffer, and from a discussion in discord, it seems a standard way to do this is to run the code once, collecting the number of bytes required, and then to return that information to the user to run it again, supplying a buffer of the specified size.
The invocation to calculate the number of bytes should avoid using any callbacks.
