And 2.5 inch drives can and often do have ports directly mounted on the laptop motherboard. If you don't want to use a cable, then you simply don't use a cable. Nothing else changes.
It's less the cable than the connector, so, similar trouble with nvme ports (and ram slots, for that matter). I've barely had exposure to supporting laptop hardware, and have seen "thing shimmied loose" or "contact corroded" as the root cause of problems more than once.