In the upcoming release of Godot 3.1, a completely optionial type system has been added to Godot 3.1.
From the Godot news page, details of how the new type system can help:
It is quite common to use a variable only with values of the same type. With the dynamic nature of GDScript, you can inadvertently overwrite a variable with a different type and break your code logic in a way that might be hard to realize.
For instance, if your function expects a number, but you missed an input validation somewhere and is passing a string to it instead, you only will see an error at runtime (and only if you reach that point). In a larger code base, it’s quite easy to miss things like that.
With type hints, Godot can know beforehand that you are passing the wrong type and show an error while you are editing the related code, even if you never run it.
You can learn a great deal more about the new type system in Godot 3.1 here. To see the syntax in action, check out the video below.