[UPDATE]: Kicad has released 4.0.7 as of August 2017, where this bug is fixed.
Well, apparently it's been fixed! However, it was fixed via this bug in April 2017. As of July 2017, KiCad's latest release is 4.0.6, which was in March 2017. If you have a release greater than 4.0.6, you will have this fix, otherwise you have to build from source code.
Once you have a version with the fix, there's an extra option when plotting with "Plot format" chosen as DXF.
Hopefully there's a new release of KiCad soon!
For now I'm using my custom-built KiCad for my needs, but only for scripted use. I'm using the official one for my day-to-day operations to avoid any "I built from head" headaches when it crashes.
Also, I recommend that if you're using KiCad for anything commercial, that you donate. If your employer is okay with that, they essentially get a discount since donations are tax write-offs!
PS: If you're scripting from source (as of July 2017) rather than from release 4.0.6, here are a couple changes to watch out for:
- The new function to use: