I know this is an old question, but thought I'd give some info that I found while trying to do the same. As far as I can tell, there is no way to retrieve gyro input from controllers in the godot engine itself, unless the gyro input is miraculously being read into one of the joy axes (which seems pretty unreliable).
To get around this, then, you need to implement reading data from external devices yourself, which is something that I think is impossible in GDScript. So there's two options left, c++ or c#. From the two, c# is probably easier since godot natively supports it, though I think it wouldn't be much harder using c++. The top answer from https://gamedev.stackexchange.com/questions/87106/accessing-dualshock-4-motion-sensor-in-windows-ideally-unity is a good guideline on what you should do, but I'll go into more detail if you're looking at only deploying to windows platforms.
You should grab code from the ds4windows github page, specifically the files in HidLibrary. In some script of your own, you should then call HidDevices.enumerate() and find the controller from these returned devices, say named gyrocontroller. You should then call gryocontroller.OpenDevice(false) to setup your controller to be read from. In _process, call gyrocontroller.ReadFile(inputReport), where inputReport is some 64 byte array defined in your script. inputReport will now be filled the most current input from your controller, which will contain gyro info. To find which bytes are relevant to gyro data is dependent on the type of controller and how it's connected to your computer, but there are references online that cover that.