Merge branch '2023-03-22-assorted-minor-code-cleanups' into next

- Minor code cleanups based on problems found by clang or enabling LTO.