I suggest to use SMT through-board connectors like the [3M 966240-2000-AR-PR](https://eu.mouser.com/ds/2/1/TS2652-1147191.pdf) to allow more flexible stacking.