A superstar for more than two decades, Aamir Khan has never been more popular than he is today, in his mid-forties: His 2008 release Ghajini quickly became the highest-grossing Indian movie of all time. So there must be something besides commercial necessity at work in Khan’s determination to keep on playing mischief-making undergraduates. In writer-director Rajkumar Hirani’s tuneful, enjoyable college comedy, 3 Idiots, Khan plays “Rancho,” an engineering student so brilliant that he barely has to break a sweat to place first in his class. Rancho always has plenty of energy left over to wage a guerrilla war against the institution’s emphasis on rote memorization—and to tweak his less-gifted classmates as humorless swots. Coming from a natural-born genius, this seems ungracious, at the very least. There’s a pro forma mystery surrounding the character, and some anecdotes of early struggle, but, ultimately, Rancho is a Hindi-cinema superhero in terms of intellect if not upper-body strength, while his nemesis, a professor played as a lisping buffoon by Boman Irani, is a slapstick pushover. In the ingenious extended finale, Rancho serves as a deus ex machina guru/savior to the ordinary mortals he has befriended along the way. Hirani embraces melodramatic convention with open arms, but he is also a crafty entertainer who smoothly choreographs his overpopulated storyline.