I have milled some XPS foam (Foam core wing, the largest wing I milled was 60x32x5 cm).
Before I started, I also ran a ground wire through the vacuum hose (and through the vacuum itself), because I was afraid of static electricity clogging everything up.
It was quite cumbersome when I had to remove the hose to empty the vacuum. When I built my cyclone, I decided to remove the ground wire.
I have milled the wings with the cyclone, without the ground wire, and I basically had zero issues with static electricity. The foam does cling a bit to the inside of the bucket beneath the cyclone, but MDF dust also does that. The electronics worked fine. I should note that my RAMPS board is on the left side of my MPCNC while the cyclone is on the right side. No idea whether the distance makes any difference.
When I did have the ground wire, I just used a bare wire and connected one end to the earth ground pin of an extension cord (same extension chord I used for the vacuum).