Connecting 2 male headers on a pcb together
I would use two female headers like this...

2X20 40Pin Double Row Female Straight Header


soldered back to back to make a female-female joiner. If you overlap the contacts they only add 15mm to the overall length (compared to a normal male/female header combination) which should not be significant at 32-48MHz.   

If any of your signals still have excessive ringing or ground bounce then you could try inserting small value resistors (10~50&ohm;) in series between the connectors.