Compile with "\--opt:speed" or "\--opt:size" and take a look at the binary. I think there's a good chance you won't find your successive memset() calls.
In my experience, GCC and Clang optimize sequences of calls to stdlib functions, in which some would affect a no-op, well. I could be wrong, but I'd take a look before trying to optimize the generated C code.
