It all depends on the circumstances surrounding the killing:
1). If a person kills in order to defend himself/herself, a relative or property, then I call it self-defense and see no reason for penalty,
2). If a person kills out of malice, rage or negligence, then the law allowed penalty for the settled crime should be exercised,
3). If a person kills due to known and verified illness, then such a person should be handled based on his/her health conditions - if it is verified that the person suffers from dementia, for example, then he/she should be in a guarded environment were he/she can be helped -
If, however, a person alleges insanity or temporary insanity, then I strongly urge that he/she be looked up in some properly run mental institution, where he/she can receive help and remain for life, even if he/she is later declared sane. I do not recommend that anyone who has plead insanity in a murder case be released into the mainstream public: Just how do we know that there would not be an encore or that someone may have merely used a system to eliminate another?