From the log, I noticed the line #188 of configure.bat
echo>>confargs.c !ifndef CONFIGURE_ARGS

output "ifndef CONFIGURE_ARGS" without "!" for some reason.

I guess this issue is related with the V option of CMD.EXE.
According to the help message:

/V:ON Enable delayed environment variable expansion using ! as the
delimiter. For example, /V:ON would allow !var! to expand the
variable var at execution time. The var syntax expands variables
at input time, which is quite a different thing when inside of a FOR
loop.

Normally this is where I'd suck it up and eat a little plate of steaming crow for not configuring my system correctly by saying something like "Sorry for the noise, please close".

But seems to be one of those tweaky issues we should make disappear. Is there a way to make configure.bat immune to /V:ON or /V:OFF in this case, perhaps by adding your @setlocal DISABLEDELAYEDEXPANSION workaround? Would it then cause problems for those using the IDE to build?

If the workaround isn't solid, I'd like to see this issue documented in win32/README.win32