Mathematical idempotency depends heavily on the function's domain. It's not too challenging to construct a non-idempotent function that has an idempotent restriction. So depending on what your domain of interest some operations may be idempotent or not.
In the hello world example, I guess we are considering 'echo' as the function. If then if we consider stdout and echo's args to be the same, echo will be idempotent.
However, stdout and command args are pretty different things on any system I know. If we care about things like command line history, then clearly 'echo hello world' is not idempotent.