Lexicon Valley has an interesting article on the origins of what is termed “symbolic swearing,” or the usage of strings of symbols to represent censored swearwords. It seems that the credit goes to Rudolph Dirks, who also notably invented the speech bubble (probably).
Symbolic swearing is an interesting example of paradox. When we see a character shouting “@*%&$,” we don’t know exactly what they’re saying; the only thing we do know for sure is that they do not intend for any of those symbols to be understood by its normal meaning.
Are there other examples of times we say something when we really mean anything but the thing we say? That’s essentially the definition of sarcasm, of course, but another example that comes to mind are the rebus characters of some languages, which is when a written symbol is used for its phonetic value rather than its meaning.
What the heck does that mean? Let’s take the Chinese character 要 for example. Originally, this character represented waist. But soon it was also used to represent want, because these two words were pronounced nearly the same. (Later, the character for waist was modified to 腰 so that both words wouldn’t have the same representation.) Notice that waist is a physical object, whereas want is abstract: You can draw a picture of a waist, but you can’t draw want. Thus it is perhaps expectable that pictographic writing systems would use rebus characters to represent abstract words, which is exactly what also happened in ancient Egypt and Sumer.