40-pin female headers are inexpensive and easy to trim down to size, and with a dot of CA glue (super glue), you can even easily make other configurations, like 2×4. Sometimes they’re even described as “break-away” headers, although admittedly they don’t break away as easily as the male pin headers. Just keep in mind that if you don’t score it, it could shatter.
Someone was looking at one of my PCBs and commented that it’s “impossible to break them apart without destroying at least 2-3 pins each time.” Using this technique, I’ve never “destroyed” any more than one, and with a little care, the edges turn out quite nicely.
Music: “The New Music” by AlexBeroza (CC BY 3.0)