I couldn't follow up this suggestion because I don't have a way of
building Denemo for Windows to experiment with. But it occurred to me
that I *could* test this idea just by swapping the executables
gspawn-win32-helper.exe and gspawn-win32-helper-console.exe around -
that is, running the opposite one that the
might_be_console_process (void)
call suggests.
I did this and it turns out that this doesn't prevent a terminal from
popping up, however there is a clue: the title of the program being run
in the title bar of the terminal changes from lilypond.exe to gspawn-
win32-helper.exe when that program is replaced by gspawn-win32-helper-
console.exe.
So it would seem that a terminal would pop up regardless of which of
those gspawn-win32 helper programs ran, but the title bar would name
the helper program rather than the lilypond.exe program.