Change output to be a reference and not a pointer.

This avoids having to check the pointer value at each use which
was not being done.
Merge topic 'pass_output_by_reference' into next

7762fffa Change output to be a reference and not a pointer.