如果输入不会存储在任何地方,是否有任何理由清理用户输入?

I can understand why user input that will be stored in a database needs to be sanitized to prevent sql injection and the like. But for a standalone script that just returns temporary data back to the user based on there original input. Is there a need to sanitize the user's original input in this situation?

Don't filter inputs; filter outputs. See my answer here.

Look up XSS Injection. Never give text to the user that you have not sanitized. The only "safe to not sanitize" string is the string you discard - pretty much anything you do with a string has a vulnerability somewhere unless you are careful.

Nobody can answer such a question.
Nobody knows your particular situation.

There can be a case where no sanitization needed, and there can be a case when sanitization required. Depends on the way data being processed.

A fellow developer had a funny service on his site, like one you described here. And everything was all right. Time passed and he decided to add a blog and authorization to his site. And got his site hacked immediately, based on trivial XSS attack through this old service.

I would say so as XSS attacks only require someone to have access to print something to the screen.

For example a text field which then just displays what ever you entered on the screen will leave you open to XSS attacks.

I recently came accross the HTML purifier php library which you might want to look at.

http://htmlpurifier.org/