The current implementation cannot return more than 1024 values due to the size of the result buffer.
It is possible to resize the buffer, but it would be more efficient if we could push values directly to the stack.
However, this implementation should be used with caution since the return value overlaps the area with Arguments.