Hello!
It's possible to have several outputs in your
Custom Expression node through using the Qualifier parameter of the added Inputs. Please refer to the image below:
Note that we've set the Output Type to Float4, so that we can pass the Color node's value that is received by the first input, In0, which is also a Float4. Values assigned to this parameter will be copied into it when the function is called and it can be modified inside function as it will not affect original one. This value is the one that I'm returning through the code, so it's passed into the original Output port.
The second input set in the node's parameters is also a Float4, with its Qualifier set to Out, which means that its value is not initialized by the function caller, so the Value parameter is ignored and you'll have to initialized it within the function. There is also a visual issue where a Out port also appears as an Input port, but it can be ignored for now as any values connected to it will also be ignored.
The third input has its Qualifier set to InOut, so it's a mixture of both In and Out qualifiers. Its value will be set to the one passed by the function call but also all changes done to it inside the function body will be copied to the original one. In this specific case I'm setting its value in the parameters.
Please let me know if this helps, I'll be happy to elaborate, thanks!