This was written for Slic3r output and as such, has only been tested with Slic3r output. It only converts arcs in the XY plane. It only works in millimeters (because the tolerance factors, defined in g1tog23.py, have been tweaked for millimeters - easy to change).
The program can read and write to stdin/stdout, or it can take the name of the file to convert as a command line argument. When passed as a command line argument, a backup of the file is made first (filename.ngc.bak) Eg
g1tog23.py < mygcode.ngc > new_mygcode.ngc
In my setup, I've added the script to the Slic3r, Print Settings, Output Options, Post-processing scripts list so the script is always run when Slic3r generates output. I run slic3r under MS-Windows, so I launch g1tog23 via a batch file.
Note that the output file size can be larger, but the number of lines will never increase. This is because x/y/z/a is always output with all digits displayed.
At the end of the new file, a summary is added. For example,
; filament used = 16140.7mm (110.3cm3) ; GCode file processed by d:\3dprinting\g1tog23.py ; Input Line Count = 561428 ; Output Line Count = 141307 ; Line reduction = 74%