All this info comes from the Du Prez/Dronfield 2016 book, mainly chapter 4. Well worth a read.
Firstly regarding the name James. Margaret Bulkley's mother, Mary Anne Bulkley was sister to James Barry, painter, and eccentric. James Barry the painter was Dr James Barry's (previously Margaret Bulkley) uncle, who died in 1806. Elder Barry's connections provided significant opportunities for Margaret Bulkley to become Dr James Barry.
Upon his death a friend of Uncle J Barry, Dr Fryer undertook Margaret's education, which as she was a woman contained no science, mathematics, philosophy, classical languages or literature. Women of the time were not supposed to need a broad or deep education!
This education was a great stepping stone along with the circle of wealthy supportive men with somewhat revolutionary ideas who had admired her uncle. This fertile 'bluestocking' ground was how the unthinkable occured, a woman, in disguise studying medicine. There was a prototype, Lady Mount Cashell (Margaret King) had disguised herself as a man for a couple of months in 1806, to attend medical lectures in France...her exploits were widely discussed at the time.
Women had limited opportunities.
For the tin-eared rewriters of history Mary Somerville a talented mathematician and astronomer, wrote in a recollection of her life in 1874 of how she "resented the injustices of the world in denying all those privileges of education to my sex which were so lavishly bestowed upon men".
More about Mary on wiki en.m.wikipedia.org/wiki/Mary_Somerville
Again Somerville was able to do well because of education and her class connections.
Chapter 5 also provides some excellent quotes from Mary Wollstonecraft regarding the humiliating work opportunities available to educated young women...
Womens history is not going to be rewritten to placate men. Hands off!