Since numbers increase the command count in a linear manner, such that 'set altitude [1..40000]` would be 40,000 command variations, you could consider that in flight simulators (and IRL), altitude can also be referred to as a Flight Level which is a standard altitude reference used by pilots and air traffic controllers. It is defined as a vertical altitude in hundreds of feet above ground level (or sea level, depending).
So, you could create a command which has far fewer commands if you only used Flight Level, such as `set altitude [1..40]` ...which would be only 40 command variations.
Just for reference, the way these are stated is like this, "set altitude four zero" (would mean set altitude to 40,000 feet), or for altitudes below 10,000 feet, "set altitude nine" (would mean set altitude to 900 feet).