I am not asking this to be transphobic or anything but I had this debate with myself at 2 o’clock in the morning and every time I remember it I can’t focus.
On one hand, it is what they want. Let’s assume it causes no harm to them or any unforeseen circumstances.
On another hand, it would erase their identity as trans people. At the extreme you could consider it a genocide, since turning them into what they want would mean there is no more trans people and their unique identity is erased.
Out of curiosity, would you feel the same if the question was, “If I could snap my fingers and cure everybody on earth who has a terminal illness, would it be unethical to do so?”
Like, you would be modifying their body without their consent. On the other hand, you’re literally curing people with terminal illnesses. Seems churlish of them to complain.
The difference would be the phrasing and specifics. “Magically switch trans people to the assigned sex at birth that they desire to be?” Works for some. “Magically make trans people’s bodies align with their specific and nuanced gender identity” is less of an issue. The problem you run into with the first is some are not interested in surgeries or are non binary so a full surprise sex swap would not be what some trans people want.
I still think consent is important though, even if the way the magic works is basically “they get what they want”. As much as it is hard to imagine, there are also trans people who do not want to transition at all due to having family or friends who would cut them off (I think that’s a pretty awful and tragic situation to be in, but imagine the trans woman who magically changes to the shock and anger of her deeply religious family or SO, who then ostracize or reject her, or even react violently). You aren’t likely to be murdered for recovering from cancer, but in some places magically shifting assigned sex might come with some pretty awful, bigoted strings attached
So you tell them, preferably ask them, first. That’s why surgeons make you sign consent forms.
Surgery has risks, magic in this case does not.
If you modify the thought experiment slightly, it becomes an interesting trolley problem.
Let’s assume the spell you’re using is all or nothing - either it cures everyone, or no one. What if some subset of people explicitly do not consent? How many people would it have to be, or what percentage, before you would consider not doing it? Obviously if only 1 person doesn’t want it, who cares, greater good, but what if it was 99% of people? Where’s the line?
A utilitarian, in that case, would always choose to cure everyone. Greatest good for the greatest number.
If your morality is a bit more nuanced, things get very muddy very quickly.