Merchant marine sailors have been filling up their discussion boards and email groups with ideas on how to defeat pirates, and a consensus has formed that the most practical tactic is to establish a drill for sending a distress message to the owner, or nearby warships, quickly shutting down the engines (including any auxiliary generators) and getting all the crew to a safe room. It's already part of ship procedure to send an emergency message quickly, and someone is always on the bridge to do so. Shutting down the engines is also a normal procedure, but doing it quickly, and making sure some savvy pirate can't get them started again, takes some planning and practice. But some crews have already done it, to good effect. Once the engines are shut down, the pirates are stuck. With help on the way, the pirates usually abandon ship, unless they capture one of more of the crew.
That's why you need a safe room, and have to get everyone into it once the pirates are on board. The safe room is a space that is very difficult for the pirates to get in to, and stocked with water, food and some toilet facilities, as well as some kind of radio or satellite phone, and whatever else the crew decides they need. There are several spaces on the ship that could be modified to serve as a safe room. During the recent capture of the U.S. merchant ship Alabama, the crew made for the steering gear space (room), which is at the rear (stern) of merchant ships and usually easy to make very difficult for someone to get into. The Alabama also took advantage of the general alarm that ships have (meant to alert everyone to a ship wide emergency) and the powerless phone system (that works when the engine is shut down, again, another emergency feature of ships) to get everyone alerted to the pirates, and down to the steering space.
Merchant sailors are a very practical bunch, and adept with tools. They also know that if the "shut down and safe room" practices are generally adopted, pirates will start coming prepared (with bolt cutters, explosives, grenades or even cutting torches). That's already happening. A Portuguese warship recently captured 19 pirates, and found that they were carrying four sticks of dynamite, along with their usual AK-47s, RPGs and boarding ladders. The pirates were disarmed, and then released, because the Portuguese government will only keep pirates prisoner if a Portuguese ship was attacked.
The merchant marine sailors discussions continue on how best to deal with each of those potential problems. As more ships defeat a pirate boarding with these tactics, more crews will adopt, and improve on, the techniques. All this also requires practice and drills (to insure that everyone can do their part in time.) Some sailors are also discussing ways to counterattack the pirates, if they don't leave. That has also been done successfully by some crews. More dangerous, but also more satisfying to crews that can carry it off.
Ship officers are also suggesting to the owners that some money (under $10-100,000 per ship) be made available for these anti-piracy improvements. Some owners are inclined to make the investment, if only for the morale benefit.