This is one of those dark areas of unix that can get sticky fast.
Each of the above examples tickles a long-standing bug in unix that these days people just regard as a cute little personality quirk.
find . | xargs rm
won't work if there are wacky filenames in the directory like newlines or white space. You may even start deleting other files not in the directory if there is a filename with a ; in it. Who knows what happens if there is a filename with a ` in it. Just ask little bobby drop tables. Things can get exciting quickly.
Bill Weiss's comment correctly points out that modern versions of find and xargs that properly use nulls as the field separators for each thing that find finds if you use the -print0 in find and -0 in xargs. Not being a trusting sort, and having cut my teeth on older, randomly broken versions of unix, I tend to be wary of these newfangled gnuisms, even though they work quite well and in this case are the correct answer to this specific problem.
rm -r /path/to/directory/* won't work if you've got 10,000 files in that directory.
Now -- mostly I just don't bother to do this right, so I'll use rm -rf and look at the error if there is an error. If I'm 100% sure there aren't wacky files, I might use find and xargs, though I don't really trust those.
If I'm doing it in a script that runs automatically, and I have no idea how long this is going to be used or who is going to use it, I try to do it the right way.
I can't really think of a quick, tidy, and reliable way to do this but I think I could do it with a bourne shell script like:
for a in * .*
rm -rf "$a"
Now -- this is safe because the for loop protects the command line of "rm" from having a billion inputs and the double quotes around the variable protect it from wacky things like escape characters or semicolons or other meta garbage. It is also far slower than the find + xargs.
So I guess the right answer is "There is no program to do that. You have to write a program to do that reliably." I guess that's what stallman et all did with find and xargs...