To use the ship attachment Rapid Cargo Evacuation Chute from Fly Casual you need to pass an “Average difficulty Mechanics check as an action while in the cockpit or cargo bay to eject everything currently stored in the cargo hold”.
If the players don’t have this attachment, how would they dump all their cargo normally? I haven’t found any rules or even guideline to this.
It is entirely up to GM ruling, as it depends on the ship and circumstance. If it’s a ship like the Wayfarer, maybe they open cargo bay doors on the module, turn off artificial gravity, and make a Piloting check—but that’s only if the cargo isn’t secured in the first place.
Most of the time, it wouldn’t be possible to rapidly offload cargo, outside of manually moving the cargo like you would when offloading cargo normally.