Comic relief characters
Now let me just say right now that I don't find Skids and Mudflap racist. I find them annoying, but I don't find them racist. If you look at a characters with gold teeth, jive talking language, and illiteracy and immediately assume black people, then you're just as, if not more so, racist for making that call. I know people who are racist, and they hate black people for no good reason. These two do not even come close to that bad.
That said, they are annoying, and totally out of place. But they're not the only ones. There's Wheelie and Brains, Anthony Anderson, and of course, Sam's parents. You want to talk out of place comedy? I'll give you a prime example: In Transformers 3, right after Sentinel Prime kills Ironhide, we get a comedic scene with Sam's parents. Dude, Ironhide just died! This is the dramatic turning point of the movie and you're pissing it away with a pothead mom!
I'm all for comedy, but when it flat out interrupts the movie for no real reason, we have a problem.