Maybe a water cannon that's big enough to create issues for typical pirate boats? I don't know what the cost is, but if the pirate boats are smallish, you have essentially unlimited ammo.
Large merchant ships do use water cannons for repelling small pirate boats. But that wouldn't really be practical to mount on a typical private yacht. They're just too bulky and heavy.