When you think of a witch, what kind of person do you imagine stirring a cauldron bubbling and boiling with trouble?

Woody Allen might conjure up a Harvey Weinstein or his equivalent, as he warned of “a witch hunt atmosphere” in the wake of the film executive’s sexual misconduct scandal. Men have been accused of witchcraft. But throughout most of history and pop culture, it’s predominantly been women at the fringes of society — poor women, older women, childless women, widows — cast as witches.

Hundreds of years ago, being called a witch could get you burned alive. Now women voluntarily call themselves witches as a way of asserting their power and independence.

As far back as the Bible, Exodus cautions that witches should not be allowed to live. Historian Jone Johnson Lewis says the height of European executions for witchcraft was from 1580 to 1650. In the United States, the Salem witch trials followed not long after. In the late 17th century, England’s rulers had just fought with France in the American colonies, unleashing refugees who strained the economy in Salem and fueled a general sense of paranoia. The community was looking for scapegoats.

So what did it take to get suspected as a witch? Historian Marilynne K. Roach, author of “Six Women of Salem: The Untold Story of the Accused and Their Accusers in the Salem Witch Trials,” cites nine traits that could mark someone as potentially tighter with the devil than with God: being female; middle aged; an English Puritan; of low social position; stubborn or contentious; related to someone suspected of witchcraft; a person with few or no children; accused of theft or slander; or ratted out by a confessed witch.

Overall, being at the margins of society marked someone as potentially untrustworthy. Not having children could make you a suspicious character because “neighbors suffering misfortune might think you were attacking their larger families from jealousy,” Roach writes. “Being too often dependent on the neighbors’ help could cause them to resent you,” she adds in describing why poor women were often singled out as witches.

Without husbands to defend them, widows or unmarried women were especially vulnerable when accused of witchcraft. “They were more likely to be reliant on their neighbors for material assistance,” according to a 2001 article on witchcraft and old women in early modern Germany. “When this aid was refused … the anger of the spurned woman was understood as the cause of certain misfortunes suffered by her wealthier neighbours as a result of the guilt the latter felt at having failed to fulfill their traditional benevolent obligations.”

However, for decades now, women have been embracing the persona of the witch, converting it from a slur to an assertion of their power in the face of male dominance. In the 1960s, women dressed up as witches to protest Wall Street, beauty pageants and Playboy Clubs. Today women dress as witches to protest anti-abortion policies. On a recent episode of the “Broad City,” comedians Abbi Jacobson and Ilana Glazer invoke witchcraft as their way of protesting the Trump era.

Writer Lindy West, a woman who is not at all worried about being branded “contentious,” has fired back at Allen in a New York Times column, saying: “Sure, if you insist, it’s a witch hunt. I’m a witch, and I’m hunting you.” By speaking out about long-held secrets of sexual harassment, women are no longer remaining silent against more-powerful men. Their power is growing with each woman who pipes up.

This ongoing quest to flip the power differential is exactly why contemporary women love witches, Anne Theriault posits in a 2016 essay in the Establishment, writing that “to be a witch is to be a woman with power in a world where women are often otherwise powerless.” Maybe that’s done by speaking out where they had once been silent, or by the makeup they wear: “Black or dark purple lipstick might currently be in vogue, but on some level they subvert traditional feminine beauty standards and the ability to subvert or reject the status quo often confers a sense of power,” Theriault writes. “To grow your own kitchen herbs and have some knowledge of herb lore are powerful in the sense that the ability to provide for yourself — even on a small scale — is a type of power.”

In her 2016 book “Spinster,” Kate Bolick also links self-sufficiency with witchcraft. In recalling her early 20s, when she was working several jobs on her way to a writing career, she fondly remembers how she would bicycle home from her restaurant gig, her pockets stuffed with cash from tips, reciting the first stanza of the Anne Sexton poem, “Her Kind”:

I have gone out, a possessed witch,
haunting the black air, braver at night;
dreaming evil, I have done my hitch
over the plain houses, light by light:
lonely thing, twelve-fingered, out of mind.
A woman like that is not a woman, quite.
I have been her kind.

Bolick writes that she doesn’t know why she became entranced by that poem.

But I’ll take a guess. Her book is all about the wealth of opportunities open to women who delay marriage and childbearing, or pass it up altogether. These days, it’s possible to be contentious and stubborn and not have to worry about being called a witch. Sure, the online trolls are bad, but they’re the ones who end up looking more malevolent. It’s possible to make a living and a make life on your own, cycling home in the dark of night, pockets stuffed with your earnings. Considering how far women have come since the days they were hunted as witches, and since 1966 when Sexton wrote those words, on good days that transformation does resemble sorcery.