Okay @DadJoke I don't need to make the point about male cleaners and male guards as others have already done so.
If someone is allowed to enter a single-sex space based on their gender ID and not on their biology then this is someone who does not belong in that single sex space. Their sex is not female/woman even if they feel like and want to be treated as a female/woman. The problem with your argument is that the Spanish Legionnaire self-IDing as female can use single sex spaces according to your preferred system. I cannot stop them. I do not assume that the risk from a transwoman is greater than that from any other male. It may well be less. But this change allows other men who may be known risks to enter protected spaces. It has happened and its not good.
I am an ethnic minority woman (not a muslim) and I looked up what the guidance is within this religion and found this from a site called IslamQA. First I asked about being in spaces with unrelated men (unsurprisingly not on unless the women outnumber the men) and then I looked up what is considered men (re transgender) ...
'First of all, it must be understood that ‘transgender’ is totally haram in Islam and hence, not permissible. This act, in reality, is changing the way Allah created a person, and showing displeasure with the gender which a person has created to be.
If Allah Has created a person to be a male, then he is a male, regardless of how he feels about himself, and in spite of the feminine manners, traits and hair style he may adopt. Thinking that he is a female, when he has been born a male, is no reason to want to change his sex or have an inclination to want to be, or behave as a female. This is not acceptable at all in Islam. A male who adopts the ways, pattern of conduct, dress and speech of a female is an effeminate person, who has been cursed by the Prophet (SAW). In this regard, Abdullah bin Abbas (RA) said, ‘The Prophet (SAW) cursed effeminate men (those who are assume the way of women), and those women who assume the ways of men. He said, ‘Turn them out of your houses’. (Sahih Al Bukhari 5856).
<SNIP as less relevant but same vein>
He must understand that Allah made him a male and he will always be a male until he dies. This is the decree of Allah for him. Trying to emulate and imitate a woman, and having a strong feeling and inclination to be like them, is totally Haram in Islam and will bring about Allah’s wrath and punishment.'
So having a transwoman in a space with a fundamentalist muslim woman is possibly worse than having a man in the space. At least as long as you outnumber the men its not forbidden.
There is push back against this and the law change in Pakistan tries to prevent discrimination. It is concerned with improving access and removing discrimination against three categories - intersex, eunuchs and trans people (listed in that order). https://www.senate.gov.pk/uploads/documents/1503334623_218.pdf It talks about access to public spaces - it does not talk about access to single sex spaces and AFAICT it would not permit this.
BTW I am not obsessed with bathrooms or changing rooms - you bring it up because I assume you think that is an argument you are strong in. In my ideal world men would not be a risk to women whatever the setting. Sadly this is not the case.