Gearing and friction losses can be fairly small.
Consider that at ~0mph and ~0rpm, producing any kind of torque at all is done with ~0% efficiency, all just resistive losses as the back-EMF is effectively zero. (Note this is no different for an internal combustion engine, although the heat generated is in the clutch or similar such device...)
Friction losses don't change much as a proportion of power as you increase speed. For aerodynamic drag, however, your losses do proportionally increase with speed, so "windage" (i.e. drag from spinning parts of the motor) needs to be cleverly reduced by making the rotor aerodynamic if you're planning on operating at high rpm.
EDIT: for properly designed electric motors (i.e. thin wire windings, iron core optimized for low eddy current losses), coil resistance usually dominates even at high rpms.