Here's an example of customizing them with code. This is a script attached to the GridContainer:
tool
extends GridContainer
func _init() -> void:
add_constant_override("hseparation", 100)
add_constant_override("vseparation", 30)
In my case I needed to increase the gaps. I used "tool" so that the settings take effect in the editor.