Are there any subtle differences between "somebody" and "someone", or can they be used completely interchangeably? Similarly, can you imagine a situation in which you would prefer "anybody" to "anyone" or vice versa?
There is little or no difference between the -one and -body variants.
However, there is a major difference between somebody and anybody--anybody is one of the "negative valency" words in English, which is required when the main verb of the sentence is negated.
I haven't seen anybody. [Correct]
! I haven't seen somebody. [Incorrect]
Conversely, in sentences in which the main verb is affirmative (not negated), the preferred pronoun should be somebody and not anybody.
I saw somebody in the hall. [Correct]
! I saw anybody in the hall. [Incorrect]
In subject position, you should prefer somebody when a particular person is implied, although you don't know who it is. Anybody can be used when you have no particular person in mind.
Somebody called me on the phone. [Correct]
! Anybody called me on the phone. [Incorrect]
? Somebody can come to the party. [Not exactly incorrect, but very strange--it implies that there is a single, unnamed person that can come to the party.]
Anybody can come to the party. [Correct]
While M-W doesn't provide any hints on difference between the two, my understanding is that someone is used more for hinting at a particular person, for sarcasm or otherwise.
E.g. I don't think I've ever heard the phrase "special somebody", as opposed to "special someone". Somebody sounds more generic.
Here's what Michael Swan says on this matter in his book, Practical English Usage (Swan 2005, OUP):
"There is no significant difference between somebody and someone, anybody and anyone, everybody and everyone or nobody and no one. The -one forms are more common in writing; the -body forms are more frequent in speech in British English" [emphasis mine - Alex B.] (p. 548).