Disable cast checks in plain builds
This is a follow-up to !2851 (merged). I notice that we are following Meson's optimization option a little too religiously here. Problem is, this option only indicates whether Meson itself adds optimization flags: it does not indicate whether the build should be optimized because it will be set to 0 for plain builds, but plain builds are production builds and are expected to be optimized.
The fix is easy: if we are not a debug build, then we're a production build. Always define the flags for one way or the other.
This improves adherence to https://blogs.gnome.org/mcatanzaro/2022/07/15/best-practices-for-build-options/ Rule 6.