Got to cull the bottom 10% every year! I wonder how many people rejoin at a later point of their career, otherwise surely these sorts of practices would be unsustainable (without hiring lots of labour from abroad?).
I lost my mum just slightly over a year ago, so I know the feeling. And all I really can say is that I'm truly sorry for your loss and that I hope you can one day look back and remember the good things. I guess that's all that one can ask for when presented with situations like these.
I can't say I've ever been in your shoes, but I've had experiences with depression, particularly in those around me. Suicide, or any form of self-harm for that matter, is never the answer. There is a way out of this without hurting yourself.
There is always a demand for experienced software engineers such as yourself. If you live in the UK, I'd be more than happy to set you up with some people I know.
That being said, if you would like a chat about anything, anything whatsoever, I'd be happy to. I put my email on my profile so you can hit me up there.
Another library that implements this, albeit at runtime (and optionally using MIRAI is https://docs.rs/contracts/latest/contracts/