Cut them off, "Oh, sorry. I'm not interested in that. I need to quickly get back to what I was doing. But you have a good day and try stay cool/warm/dry/etc. out there." Start stepping back, "And be careful of the dog four doors down, it's a fucking cunt."
As you close the door, say "You too, bud." regardless of what they say, even if they say nothing.
They will never return or pursue, and you won't feel rude.
Eh, I save rude for the second "Leave." It's a human being on the other side of the door. Half the time it's some kid who just needed a job summer before college. I say hey, I don't want solar panels right now, have a nice day.
Now, when you tell me to wait, as you stand on my porch, then I'm going to tell you to get off my porch. I still say please though, because my kids might be listening, and I strive to use good manners in all my interactions, in the hopes they will too. You can be firm and polite.
I'd rather shovel shit than annoy others by doing such an asshole job. There always is a choice.
Even working in an Amazon warehouse is more fulfilling than invading peoples home trying to force them to buy whatever it is your employer wants to sell, using all kinds of dirty tactics.
"just get another job bro". Easier said than done pal, being a door-to-door salesman isn't exactly the most lucrative career in the first place, and everyone's gotta eat.
here's what we do,
A: don't open the door if you see it in advance, however our house is built where other than our electric doorbell we can't see who's at the door, peephole is old and foggy.
B: "oh no thanks we're not interested" often filled with a "no dangit [dogs name] stop barking" / "get back" then close the door because the dog is trying to get out