Has anyone ever thought why in swearing people use not only the imperative "иди", but also (and even more frequently) the form "пошёл"?
The past tense is used not only in swearing but also in very rude commands. A very angry teacher, for example, could tell her student:
Ну-ка встал и вышел из класса!
As a vivid example I remembered the infamous scandal about the Russian pop singer Philippe Kirkorov who was very rude to a journalist. At this point in this video he starts using constructs in question:
Взяла и ушла отсюда! (with incorrect stress on взяла)
Встали и ушли! (uses polite plural form, feel the irony :)
... Встала и ушла отсюда! (to hell with the plural form :)
As an intuitive speculation, I think that the past tense is used because it implies that you're not asking, rather, it's as if so certain that the other person will obey that you can as well use the past tense! Something like that :)
Another variation of this phenomenon could be considered the using of first person plural past for insisting (but not rude) requests:
Побежали! (instead of Побежим!)
Пошли! (instead of Пойдём!)
I think the past imperative emphasizes the same degree as in German dass-clauses: Geh weg! vs. Mach, dass du weggehst!
So, the past not only refers to a command like one to a dog, but expresses a real intention. It's also that because of the existence of "пошёл на..." "иди на..." expresses a moderate degree of a curse. As if I'm not seriously asking someone to go away. Though in some cases even "иди на..." might be enough to get killed at once.
"Иди на.." implies general recommendation like a kind of status within the context that provokes the curse or like an advice to keep the subject away from the speaker. "Пошел на.." expresses stronger imperative, more like a request for immediate action to terminate the irritating subject like "do it now". Sometimes used when speaker feels that his/her previous "иди на.." curse is being ignored but this time in conjunction with stronger (more offensive) direction. "Пошел на.." is more aggressive.
Using past tense as imperative is aggressive, offensive, and not accepting any resistance. You may understand "Пошёл..." as "You must have been already going".
This form can be used in any phrase.
But, as Armen said, it can be not offensive if someone says "Побежали", "Понесли", "Взяли", meaning "us". That may be understood as "Let's run"