In the movies, pirates have been known to make a captive walk out on a plank that hangs over the edge of the ship like a diving board. There’s no record of this occurring on a real-life ship. A popular 1724 book, A General History of the Pyrates, claimed that ancient pirates would throw a ship’s ladder over the side and tell captives they were free to leave, if they want to make a swim for it. That idea evolved into the “plank” in fiction.
That said, pirates did have plenty of creative ways to torture and kill people. Keel-hauling means throwing a person overboard on a rope, and passing them underneath the ship (the keel being underneath the ship). Maybe you’ll drown, maybe you’ll be ripped apart on the barnacles, or, hey, maybe you’ll survive.