In the book and film, The Peaceful Warrior, Dan Millman says to his mentor and spiritual guide Socrates, “You're out of your mind!” Socrates answers, “And it's taken me a lifetime of practice.”
What Socrates means here is that he is not being driven anymore by his dysfunctional, “rational” mind that brings so much turmoil and misery. He has stopped thinking that he is this ego-mind, he does not identify with it, and has gotten in touch with a higher state of consciousness, his soul.
This is different from the lunatics who are so controlled by their fearful and flawed ego-minds that they behave in ways that are harmful to themselves and alarming to others. That is the madness of being under the sway of a delusional brain system and it is in no way optimal.
The form of lunacy that demonstrates optimum consciousness is that of rising above the twists and turns of the fear-based mind and delving into the peace of the next level of consciousness. In that sense, it is a great thing to lose our minds.