Debug asserts aren't enabled by default in optimized build

fixes #17081
Disabled debug asserts in optimized builds