I'm trying to optimize a vector graphic for laser cutting at the fastest possible speed. Since the laser takes much longer to do curved paths, I wanna try converting all my curves into a series of straight paths and see if that will help. My files are large and complex, but here's a simple example:

I want to turn the left image into the right image

The original path is on the left. The end result is on the right.

Is there any way to automate this, either using Illustrator, Inkscape or other vector graphic software?