idempotency means that f(X) = f(f(X)). Modifying the X inbetween is not allowed.
Is there really an initial environment where rm * ; rm * ; does something different than rm * once?
Your example is changing the list of files, or arguments to rm between runs. Same as pc85’s example where the timestamp argument changes.
If you run rm * multiple times, the state of the system changes each time because that ‘timestamp’ ends up being different each time.
But if instead you run an rm on files older than a fixed timestamp, multiple times, the resulting filesystem is idempotent with respect to that operation, because the timestamp ends up set to the same value, and the filesystem in every case contains all the files added later than that timestamp.
if * expands to the rm binary itself, maybe.
# rm rm
rm: command not found