The toml spec says it is like this:
# This is a full-line comment
key = "value" # This is a comment at the end of a line
… so the editor would need to understand that for toml, and just comment each line as appropriate for a language like toml.
Did you try installing gedit-plugins, enabling “Code Comment” and then using ctrl-m and shift-ctrl-m to toggle?