On cars at least, the hot wire or whatever is in what's called an air mass meter and for sure the density of air is less at altitude and the meter measures less mass.

It should be a given that less horsepower requires less fuel, although carbs can't deliver on that promise as efficiently as FI. Constant velocity carbs are best at it.

In addition there's less aero drag on the whole bike and in mountains and hills there are lots of downhill stretches that require basically nothing from the motor. That is, the motor does less work, which is good for consumption, too.