It should be illegal, but those caught attempting it would get rehabilitation rather than punishment.
Why? Do people not own their bodies?
Self-harm is restricted in a lot of ways, for example hard drugs. A libertarian would oppose such restrictions in general but some I'm okay with. For suicide I don't see such a ban as something to be enforced, just symbolically saying that this is wrong.
Suicide is not necessarily harmful though. In many situations people might consider death an improvement over their present conditions.