I commonly see the .1" pin headers (single or dual row) and sockets used for this.
https://www.te.com/usa-en/products/connectors/pcb-connectors...
https://www.te.com/usa-en/products/connectors/pcb-connectors...
- The distances you can get are limited to a small range (roughly the height of the male header pins).
- The 1-row versions are not shrouded, meaning that it's easy to mis-plug the pcbs (put pin 1 into the slot for pin 2 accidentally).
A Sullins connector doesn't have this problem, but of course doesn't allow parallel mounting of pcbs but at a 90 degree angle.