Personally, I think you're not "hanging up on" someone if you say, "I'm hanging up now," and then hang up. No matter who they are. Or, "bye" works as well ("sorry, wrong number! bye").
In the case of someone ranting at me, I think that's what I'd do. I wouldn't wait for "my turn to talk"--I'd just say, "You're shouting at me and berating me, and I don't want to listen to it. I'm hanging up now. Bye." And then I'd hang up.
And I wouldn't answer the phone if it rang again right away. Because I'm pretty sure it's them, right? and why get into it. If I had any way to screen their calls, I'd make them wait 2 days to get to speak to me again.
Another option is to just lay the phone down and walk away. But if they really are scolding you without letting you be part of an actual conversation, i think your hanging up is a stronger message.
I think you dilute it by answering when they call back, though.