If I'm not mistaken, this is Pharo's eval command line handler you're talking about. If so, it is not correct to say 'it also return the result of that method or yourself'. To return the result (and print it to stdout) of that method is the goal of eval command line handler.
How about making your method to return empty string, or better create your own command line handler. I believe the minimal you need to do is to subclass EvaluateCommandLineHandler, override class method #commandName and override method #evaluate:. Something like this, perhaps
ProceesCommandLineHandler class >> commandName
�� ^ 'process'
ProcessCommandLineHandler >> evaluate: aStream
�� Smalltalk evaluate: aStream.
Save your image, then you can call
./pharo -headless myimage.image process StandardFileStream stdout print: 42
and it'll print 42 and nothing else.
I'm not sure I understand the double quote (") character issue that \" solves. Example?
����