I haven't heard the two myself, but the M40X is closed which means it's going to have a much smaller sound stage. The M40X is described as having a slight V-shaped sound signature, which means boosted bass, boosted treble, and recessed mids. However the V curve isn't supposed to be too sharp on the M40X.
The AD700X is one of the highest rated gaming headphones. The sound stage is unrivaled in its price range, but it's open which means it leaks sound (people will hear what you're listening to) and provides no isolation. There is a closed variant of the AD700X called the A700X, which should have a bit more bass impact than the AD700X but greatly reduced sound stage.
I use the A900X, which is a model above the A700X. Mids are more forward, compared to the recessed mids that a V-shaped sound signature brings. Bass impact should be a lot less than the M40X, treble should be less harsh/fatiguing too.
For gaming, go with the AD700X if you don't care about isolation. It will present music in a different way than the M40X, I don't know which wins in clarity and detail.