They would just encode the OP_RETURN script into an Output structure. I'm not sure about the question - you seem to give the answer yourself in the first paragraph?