Kal Penn has highlighted racial stereotypes prevalent in Hollywood by sharing “awful” audition scripts he was given in the early years of his career.

Penn, an Indian-American actor best known for his roles in the Harold & Kumar films and the TV series House, uploaded excerpts of the scripts to Twitter. They highlight television, film and advertisement roles that play up cultural stereotypes, including auditions for a “Gandhi lookalike”, “snake charmer” and “Pakistani computer geek … in a perpetual state of perspiration”.

“Found a bunch of old scripts from some of my first years trying to be an actor,” Penn wrote before posting screenshots from shows such as Sabrina the Teenage Witch, The King of Queens and Smart Guy.

Several of the roles called for Penn to speak with an accent, usually for humorous effect. In one unnamed audition for a character named Careem, the script calls on to speak in a “slight Hindi accent”. Penn said casting agents asked him : “Can you make his accent a little more authentic?” He added: “That usually meant they wanted [The Simpsons character] Apu.”

Sabrina the Teenage Witch! Man. We got INTO it about why he had to have an accent. I'm laughing about it now but they were such dicks 😂 pic.twitter.com/kXdHjVsqvT — Kal Penn (@kalpenn) March 14, 2017

Referring to another audition, for a character named Prajeeb in the American TV series Sabrina the Teenage Witch, Penn said: “We got into it about why he had to have an accent.”

Other scripts played up cultural stereotypes surrounding characters of Indian and Pakistani heritage. In an audition for one of Penn’s first commercials, the character description refers to a “25-year-old Pakistani computer geek who dresses like Beck and is in a perpetual state of perspiration”. “The makeup people would use Vaseline to get the sweaty unwashed look going,” Penn recalled.

Another script, for a project called The Marriage Clause, has an extended joke about the high population rate in India, while the script for The King of Queens features a mix-up over the pronunciation of a character’s Indian name. “I used to love that show until I got to audition for it,” Penn wrote.

Friggin King of Queens man! I used to love that show until I got to audition for it lol pic.twitter.com/2BYu0nnd57 — Kal Penn (@kalpenn) March 14, 2017

Not all of the scripts Penn received were as problematic. “There were also some wonderful first audition and work experiences,” he wrote. “Stuff like The Steve Harvey Show, Buffy [the Vampire Slayer], Angel, 24 [featured] really smart, creative people who didn’t have to use external things to mask subpar writing.”

Racial stereotyping of Indian- and Asian-American actors has been much discussed recently. Comedian Aziz Ansari highlighted the practice in an episode of his Netflix comedy series Master of None entitled Indians on TV, in which his character fails to receive a callback for an audition because he is unwilling to use an accent.

Silicon Valley star Kumail Nanjiani, who is Pakistani American, has also spoke of the issue. “For brown guys, we’re still in the phase where we’re stereotyped as either nerdy dudes or terrorists, and I think we’re transitioning out of it, hopefully,” he told Vulture.

Penn is currently appearing in the TV drama Designated Survivor, which stars Kiefer Sutherland as a low-level US politician who becomes president after a terrorist attack kills the current president and his cabinet staff. The series marks a return of sorts to the White House for Penn, who was associate director of public engagement in Barack Obama’s administration.

In January, Penn crowdfunded an appeal for Syrian refugees after receiving racist abuse on Instagram. “To the dude who said I don’t belong in America, I started a fundraising page for Syrian refugees in your name,” he wrote on Twitter. He raised more than $800,000 (£635,000) for the humanitarian charity International Rescue Committee.