My assumption was that the former student was in his early thirties. If the student is younger, though, the assertion that the central character is gay because somebody he used to know thinks he is is still fairly bizarre- especially since the screenwriter was LGBTQ+ playwright Paul Rudnick, who you'd think would have avoided tropes like that.
Perhaps the studio was insisting that the stereotypes be included because it didn't think the audience was ready for a leading character in a movie to be non-stereotypical.