The development of noun classes is unclear and varies between languages. Instead of developing a marker to divide nouns into two classes, some gender systems probably arose via mergers from a multi-class or multi-classifier system. Thus the choice between your 1 and 2 is simplistic. Fortunately I wasn’t suggesting either of them — your comment is unrelated to any point I was making.
Note that many languages with two noun classes make an animate/inanimate distinction, not a male/female distinction. (The linguistic term ‘gender’ does NOT mean the classes are sex-based, just that noun class can influence accompanying adjectives. Since there was much confusion upthread, let me say explicitly: In languages where the ‘gender’ distinction is between animate and inanimate, linguists call the two genders ‘animate’ and ‘inanimate’, not ‘masculine’ and ‘feminine.’)
Proto-Indo-European is widely agreed to have had a two-gender, animate/inanimate, system. Here’s a pdf which goes into much detail about gender in general and PIE in particular. It subsequently split into a 3-gender system (though some think feminine gender arose as a split-off from inanimate not animate*); in various branches mergers led to different 2-gender systems or even, like in English, the disappearance of basic noun genders. *- Since the terms ‘animate’ and ‘inanimate’ are imposed by present-day linguists, it may not be necessary to view this misogynistically!