This section of gmc.cfg with my testing of [keyboard] with 3 comment options:
# comment 1
[keyboard]
# comment 2
comma=["switch", "s_flipper_left"]
# comment 3
period=["switch", "s_flipper_right"]
Without any comment both comma, and period work as expected.
With only comment 1 in place, neither comma, not period work.
With only comment 2 in place, comma does not work, period does work.
With only comment 3 in place, comma works, period does not work.
Adding blank lines between comment and next line has no effect.
Writing out as LF / CRLF . CR has no effect.
Saving with notepad.eve has no effect
Saving as DOS from Gvim has no effect
Saving from notepad++ with EOL set to lf has no effect
Saving from notepad++ with EOL set to crlf has no effect
I'm testing in windows environment.