Is the mass of an individual star almost constant throughout its life?
Mass loss is one of the most important features of stellar evolution! I suppose much depends on what you mean by "until its death".
It is true that most of the mass loss occurs during the last 10-20% of their lives - either in the asymptotic giant branch phase for stars less than about 10 solar masses or the supergiant and Wolf-Rayet phases for massive stars. During these phases the star could easily lose more than half its mass in powerful, radiatively driven winds. It is because of this that stars of initial masses up to 8 solar masses leave behind white dwarfs of a solar mass or less, and why even stars of 20-30 solar masses may end up producing 1-2 solar mass neutron star remnants. Without mass loss there would be many more (and more massive) black holes.