I have done music for a few short films for free. It has allowed me to learn how to do it, and, with word of mouth, made me meet people looking for music for their film too (the problem is they didn't have any money neither - damn it!!!

).
If the project is artistically interesting AND if it doesn't take too much time, then why not? But it takes always more time than you thought it would at first, and 40 mn is quite a long run...