Frees a given message buffer if not `nullptr`. And the ones that follow contain small but common code patterns used in many of the core modules. They are intentionally defined as macros instead of inline methods/functions to ensure that they are fully inlined. Note that an `inline` method/function is not necessarily always inlined by the toolchain and not inlining such small implementations can add a rather large code-size overhead.