core: Provide functions for different byte orders

Rationale: see #1586.

Some of these builtins seems to create warnings in other toolchains, too. E.g. with older versions of the CodeSourcery toolchain for ARM.