It needs taken apart. Get two buckets of gasoline, just a few inches deep to immerse the tool components. Gasoline, because it's inexpensive and great at rinsing away oil. Dip the parts in bucket 1, agitate them around good, remove and thoroughly shake excess off.
Dip in bucket two, thoroughly shake off. Do the motor, brush assembly, and switch assembly first so your 2nd bucket is clean still. Any minor oil residue remaining behind on the rest won't matter, except do a final scrub of the rubber overmolding with hot very strong detergent solution.
Let air dry. Once dry, re-grease the gearbox, re-grease the motor bearings if not sealed, or oil them if bushings, and don't forget the impact mechanism. Any metal on metal must be regreased or oiled.
Do not use WD40, that alone is contamination. Alcohol (most if not all types?) does not dissolve oil. If you want something effective, nasty, and expensive, brake cleaner will work except I don't know if it's safe for rubber overmoldings. You would likely still need to relube everything mentioned above.
Use your oily gas in your 2 cycle equipment, still needing to add more oil to hit the mix ratio correct for the equipment. Strain it first if there's particles in it.