ENH: optimize byteswapping via intrinsics

Byteswapping is implemented in hardware on x86 cpus which is more than
double as fast than the existing implementation.
The masked version used for 32bit plays better with compiler pattern
matching so it can be optimized also by non-gcc/clang compilers.
Merge pull request #3309 from juliantaylor/optimize-byteswap

ENH: optimize byteswapping via intrinsics