I am wondering about how many major and minor keys there are and why.
Here are some suggestions:
One could argue that there should be one major and one relative minor key for each of the 12 equal tempered enharmonic notes, that is for each of
C; Db(/C#); D; Eb(/D#); E; F; F#/Gb; G; Ab(/G#); A; Bb(/A#); B
totalling 24 keys.
This would in some sense be supported by the mere idea of 24-key set compositions such as Bach's The Well Tempered Clavier and Chopin's 24 preludes (although the choice of enharmonic high-number sharps/flats key signatures vary in different composition sets).
Sticking to the idea of enharmonic notes and the 24 keys but making a difference between the note names F# and Gb since they require an equal amount of sharp and flat symbols in their major and relative minor key signatures, and in that way seem equally relevant, yields 26 keys.
If you count keys while you keep adding sharps or flats, until all seven natural notes (A to G) have a sharp or a flat symbol in the key signature, you end up with 30 keys.
That is the 15 keys
C; F; Bb; Eb; Ab; Db; Gb; Cb(!); G; D; A; E; B; F#; C#(!)
in majors and their relative minors.
Counting all seven natural notes (A to G) on their own, as well as their respective flattened, and sharpened notes we get 21 note names as a basis for keys. That is
Cb; C; C#; Db; D; D#; Eb; E; E#; Fb; F; F#; Gb; G; G#; Ab; A; A#; Bb; B; B#.
Major and relative minor keys for each of these 21 gets you 42 keys (indeed with a lot of double sharps of flats in twelve of them).
Infinate number of keys
Albeit seemingly ridiculous someone might amuse himself/herself with for instance "transposing" 'Also Sprach Zarathustra' from C major to A### major1 ("A triple-sharp major" with 24 sharps in the key signature :-) or use any other super-sharp/-flat key. This is to say that you can invent pretty much as many keys as you please.
So, is there a consensus on or a standard answer to how many keys there are?
When asked "How many major and minor musical keys are there?", what is the generally accepted correct answer?
Why, and says who?
I am pretty sure I know what's considered the answer to how many keys there are, but I would like to know why and who settled for this.
In case you find that it matters I'm referring to 12 tone equal temperament. I could otherwise perhaps further have suggested, say, nine (usable) keys for e.g. quarter-comma meantone temperament.
1 I stole the example from a joke by the Finnish orchestra Retuperän WBK.