At the earliest layer of writing — the West-Semitic marks — Yhwh is not described as a body with a biological sex. Yhwh’s self-revelation uses masculine and feminine imagery as teaching metaphors, while remaining beyond human categories.
Images are instruction, not anatomy. Yhwh’s nearness is shown as Father and King, and also as Mother, midwife, and comforter.