I have static when I plug my acoustic electric guitar in for recording. I do not have this when I plug in a mic. I’m using a focusrite scarlett 2i2 audio interface. The static occurs during recording and when in standby.
check your cables and where they are in the neighbourhood of.
It is as pointed in your post, static electricity in the environment.
This should not be related to the software.
I checked my cables and they look like they’re in an area that should not cause issues when recording. They’re also in the same area as the xlr cable for my mic and I’m not getting static when using the mic. There is nothing wrong with the guitar cable when plugged into an amp either.
guitars are noisy, that is just how it is. if you hear the noise levels change when you are plugged in a walk around your room a bit and turn your self you will hear how pickups pickup electromagnetic radiation around you (from house wiring for example).
Most people use a DI box to get the best signal balancing into a DAW.