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]
Here's what Garner's Modern American Usage says:
The two terms are interchangeable, so euphony governs the choice in any given context. In practice, anyone appears in print about three times as often as anybody.
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.
The variations ending in "-body" tend to sound less formal than "-one." Which one you use would depend on your audience.
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).
In the New Oxford American Dictionary, both the words are used to mean person of importance or authority (a small-time lawyer keen to be someone; I'd like to be somebody; nobodies who want to become somebodies); in definition of somebody, it's reported that it means some person or someone.
I think nowadays they're perfect synonyms. Trying to find a difference would be like trying to find an inner meaning to some weird movie which the producer made just for fun.
Anybody and anyone are completely synonymous and there's really nothing more to tell.