Arduino due digital pins programming.

long value = REG_PIOC_PDSR;

that reads all of the bits at one time, or as close as you can get with modern hardware.
The subsequent "moving bits around" isn't instantaneous, but it all operates on the bit values that have already been read, so it doesn't matter...

Aren't most encoders specifically set up so that some bits are know to change faster than others? And if you read the slow-changing bits after you have a stable set of fast-changing bits, you can be pretty certain that your overall reading is OK?