The capacitor is going to lose all its energy, CV
2/2, either way. In the case where a motor is used to store the energy in another form (say as gravitational potential) only a fraction of that energy is thermalized, i.e, 'turned to heat'.
Electric motors can be very efficient, so better than 40% conversion is indeed possible. The main problem is that the voltage gradually decreases, so that simple motor won't run at its optimum voltage. In principle there are ways around that.
Mike W.
(published on 07/08/2009)