This is similar to the grappling hook/grapple gun ideas that people have suggested, only instead of it being a handheld gun it's a cannon.
This cannon shoots huge harpoons that are attached to a reel by a chain, the reel would be next to the cannon. These get stuck in the hull of other ships, after a successful hit you would need to reel in the harpoon, similar to raising the anchor, this would be faster with more than one person on the reel, which would result in the ships getting pulled closer together. Hitting the chain or the reel with a cannon ball would destroy the chain, freeing the ship. (Imagine how cool and battle worn your ship would look after a battle if it had a huge harpoon sticking out of the side of it!) You could remove the harpoon if you wanted to by interacting with it outside your ship and patching up the hole like usual. This could help with long chases or boarding enemy ships. When you customize your ship you could chose whether to have all normal cannons or a harpoon cannon on each side (3 normal cannons and one harpoon on each side.)
EDIT: Just thought of this, since the harpoons would be huge items they could be intractable like chests. So maybe your ship starts with 2 harpoons in each cannon and you could buy more at a weapons dealer or whatever. Or maybe you could find them on islands? So you would have to walk up to the cannon holding the harpoon and load it like that, would look so cool.
Here's a picture of a harpoon cannon that I found on google for reference:
