My son who was normally very well behaved and polite also did this around age 6- and usually only to ME. It really was maddening, so I feel your pain.
However - looking back, I do realize that some of this was just his age. Not the snottiness, but the 'not paying attention', lallygagging, taking forever, forgetting stuff, etc. I think boys are especially prone to this, and now, at age 10, my son finally seems to be coming out of it!
But be sure to separate just his brain processing a lot of stuff from him actively misbehaving or being rude to you- they are definitely two different things. One- the wandering attention- is harder to deal with and you just have to be patient and keep directing him calmly and reminding him what he needs to be doing.
The actively ignoring you or being snotty or rude, I didn't put up with either. I think the key thing- the same as with a toddler- is to confront him about it RIGHT WHEN HE DOES IT.
If my son talked back to me or said something snotty, I would stop and just give him 'the look'. Then I would repeat back what he said in exactly the same tone of voice and ask him "Why did you say that to me? Why did you say it in that voice? That is NOT a nice way to talk to anyone and you are NOT allowed to talk to me that way."
I would ask him to apologize for using a snotty tone of voice and say" If you have something to tell me or you don't like something, that's fine. but in our family we are respectful of ourselves and other people and we talk the way we want other people to talk to us."
I also make it clear that I am the final authority. 'This is not a democracy- it's a dictatorship' was and is our mantra, lol. A kind and benevolent dictatorship, but still!
Punishment never really worked, although we would take away tv privileges and playdates. But again- an immediate consequence seemed to work best. I also made him write lines " I will not be rude to my mother" and just made him sit in a chair where I could see him, doing NOTHING, for a while. Because those things happened right away, they seemed to have more effect.
It's just like dealing with the 2 year old version- keep your cool, try not to take it personally, and stay calm. You're the mom- you can do it!