I am an agnostic in a muslim country, and I think about this question from time to time.
So, if I do that I will have to basically larp as muslim, pray everyday, fast during ramadan, raise any potential kids muslim. This could potentially make me either happier or miserable (religion + raising kids and having that responsibility sucks). If I get a good enough job it will be possible to find a wife, but I think still pretty hard because women still care about looks. This is pretty much betabuxxing with religion with an eliminate of gambling.
There are two alternatives,
refuse to go through all that trouble and probably die alone.
attempt to go through a more liberal route that is growing in my country, which is meet girls in university or through friends or online and grow that relationship, and here is where the line intersects with traditional marriage where you go ask for her hand in marriage bluh bluh bluh. Obviously this needs pretty good social skills.
Now if I wanted to complicate that even more I would add a condition, be irreligious, which slashes the already limited number of people in this route (there is a growing number of irreligious youth, BUT they are usually both upper class and westernized and limited) and pretty much outs me as irreligious which can damage any potential friendships or relationships or reputation.
Any route seems like an extremely uphill battle.
I try to avoid thinking about this too much, I barely have any friends in uni since I moved here (I have HS friends but that was in a different country I stay in contact but feels like its only delaying the inevitable) and my goals right now is to do well in uni (not going great) and when on campus teaching comes back overcome social anxiety and insecurities that sometimes keeps me from even going to uni and maybe just maybe make a few friends. Thinking about stuff like this usually overwhelms me, so I try and set a lower more realistic bar which right now is do well in uni get a good job and be content with being alone but not be socially anxious when dealing with other groups of people.