Could we say that an individual star is almost a closed system?, as many of the stars like the sun don't exchange significant amount of their mass with their environment (except solar flares & other material ejections)
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.
It does not exchange mass directly, but it radiates energy.
From equation $E^2 - (pc)^2 = m^2c^4$, you can see that the mass of the star decreases if energy is radiated.
So, the mass of the star does not remain constant.