You asked
Is the canon ef 40mm f 2 8 stm worth it?
Here is what the site says about that.
From Canon EF 40mm f/2.8 STM: Canon EF 40mm f/2.8 STM: A prime lens by Canon for Full frame cameras, 40mm f/2.8. Specs - Maker: Canon - Focal length: 40mm (prime) - Maximum aperture: f/2.8 - Made for: Full frame sensors - Mounts: Canon EF - Stabilised: no - Autofocus: yes What it frames like - On full frame (Canon EF): as marked, 40mm. - On APS-C (Canon) (Canon EF): like 64mm on full frame; f/2.8 gives about the depth of ...
From Sensor sizes: Is full frame worth it?: For low light, events, and portraits with very shallow depth of field, yes. For travel, street, wildlife on a budget, and most hobby photography, a good APS-C camera with good lenses is enough, and you'll carry it more. Lenses and light matter more than the last stop of sensor performance.
Quoted from this site's pages.