Taliban esque punishment would likely be getting your tongue cut out, or at the worst, decapitated.
Its not excessive. In the courtroom you show the judge, there by association the court, absolute respect. Overdramatic yawns sound to me like a mixture of bordom and lack of remorse for the crimes committed, not to mention contempt of court. I think he got off easy, I'd slap him with 6 months and not accept some petty, half assed apology.
People need to learn respect. One step at a time.