>Until relatively recently, the terms "gender" and "sex" meant essentially the same thing and could be used interchangeably
Um, no, absolutely not, it's literally the opposite, the term "gender," was essentially introduced to be distinct from biological sex. Its entire purpose for existing is to be different from "sex."
https://en.wikipedia.org/wiki/Gender
>Gender is the range of characteristics pertaining to, and differentiating between, masculinity and femininity. Depending on the context, these characteristics may include biological sex (i.e. the state of being male, female or an intersex variation which may complicate sex assignment), sex-based social structures (including gender roles and other social roles), or gender identity.[1][2][3] Some cultures have specific gender roles that can be considered distinct from male and female, such as the hijra (chhaka) of India and Pakistan.
>Sexologist John Money introduced the terminological distinction between biological sex and gender as a role in 1955. Before his work, it was uncommon to use the word gender to refer to anything but grammatical categories.[1][2] However, Money's meaning of the word did not become widespread until the 1970s, when feminist theory embraced the concept of a distinction between biological sex and the social construct of gender. Today the distinction is strictly followed in some contexts, especially the social sciences[4][5] and documents written by the World Health Organization (WHO).[3]
>If someone wants to hold the unscientific (and IMO weird) view that, for example, "otherkin" is a gender, that is perfectly fine by me.
Gender is not a scientific concept, it's a social one. Gender categories and concepts are not uniform throughout history or cultures.
Even biology isn't so clear cut, there also exists people who are intersexed to varying degrees. Is it "unscientific" to call someone who has female sexual organs but has a Y chromosome a women? Maybe, but it makes sense on a social level and if she wants to be referred to as a woman.