Downsample GPS track
Ramer–Douglas–Peucker algorithm sounds like what you are looking for!
https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
This algorithm allows you to simplify a sampled path. Basically, given a maximum allowed error, it proceeds by evaluating if a sequence of samples can be represented well enough (wrt the error) with a straight line between the first and the last point: if all the points in-between them falls under the error, all of them can be removed, otherwise it tries again with a shorter sequence.
This means that, setting a reasonable error value, on a straight road it will go for strong downsampling, while on an hairpin turn it may even decide to not downsample at all.
It seems there is a ready-to-go implementation in python https://github.com/fhirschmann/rdp
Eventually, you may find this talk from EuroPython 2016, about &quot;Handling GPS Data with Python&quot; by F. Wilhelm (I learn about the algorithm from this)