In a sense, you could argue Portia’s role in the play is to subvert stereotypes about women that were present during the sixteenth century and are still present in the twenty-first century.
Now, at first, it might not seem Portia’s role is so subversive. Initially, it seems like Portia’s role is rather typical for a cis woman character. She’s a remarkably attractive person, who, because of her gender, lacks agency. She can’t even choose who she’ll marry (which depends on the sexist assumption that she must marry in the first place).
However, as the play unfolds, Portia’s role expands. She exposes the construct of gender when she dresses up as a lawyer and uses her gift of rhetoric and knowledge of Venetian law to save Antonio. You could claim this scene shows that gender is not a true limitation. The restrictions placed on genders aren’t an inevitable fact of life: they’re a product of sexist societies. You might say that Portia’s new role as a lawyer proves that women can be anything men can be.
Portia’s role might also highlight that notion that women are not always beacons of virtue. Women, like men, can be morally compromised. Yes, Portia does rescue Antonio, but she also appears to punish Shylock in a way that could be described as excessively cruel or even anti-Semitic. She seems to go out of her way to leave him destitute and to compel his conversion to Christianity.
In a way, Portia’s role is twofold. Her character shows that women shouldn’t be held down as romantic objects nor held up as symbols of virtue. Women—like men, like any person of any gender—are complex.