Get a restraining order, but they won’t do much.
Have a guy friend with a deep voice call, hopefully ex-military. They’ll be calm, but exacting in their words.
“Hi. You are current threatening a person very close to me. This will stop, and this will stop now.
This is not a threat, this is a promise. She wants nothing to do with you and your actions have ensured that she never will. Not today, not tomorrow, not ever.
Do not call, do not write, and keep your distance in terms of miles, not meters.
This is not a joke, it is not a game, and it is very serious.”
They’ll hem-haw and protest.
Then: “Are you finished? Good. I’ll say again, you are threatening a person very close to me. This stops now.
Do you understand?”
Once they say yes (they will), you should be good.