That very much depends on what you mean by "in game."
During a game?
Certainly:
PC: "I fall on my sword."
DM: "Okay. You die."
Using standard combat options?
No.
At least, not guaranteed at every table by a common understanding of the rules.
Coup de grace requires that the target be helpless before it's an option, and whether you're helpless to yourself is going to split the audience of DMs down the middle, more or less. Some will say no, you aren't helpless to yourself ("heck, people flinch away from their own razor!"), and others will say sure, go ahead and coup yourself out.
The combat actions and options made available by the game just aren't intended to cover every possible violence that a PC could commit. If you're alone, just you and a basket of puppies, and you pick it up and hurl it over the cliff, do you have to roll initiative? No — there's nobody there to contest with for the initiative. There's no action involved that's combative. At most it's a skill check, if for some reason there's the possibility of fumbling the throw and not disturbingly dispatching the puppies. It's not even a coup de grace.
When you're dealing with a character committing suicide (for whatever reason), unless it's suicide-by-battle the combat rules aren't engaged by the action. It's just violence, tragic or senseless, committed by the character against themself, vetted by the DM as possible and properly executed, and observed by your fellow players as a contribution to the shared imaginary space you're all consenting to create.