Generate geometry using geometry shader
A workaround can be generating all the splines in the same object. 

Should be around 1 minute or less from the given information (20K splines of 500 vertices).
Of course here, I've used generated coordinates.

import bpy

n_curves = 20000
n_points = 500

curveData = bpy.data.curves.new('myCurve', type='CURVE')
curveData.dimensions = '3D'
curveData.bevel_resolution = 0
curveData.bevel_depth = 1

for i in range( n_curves ):

    # splines.new adds a new spline inside the data (in the same object)
    polyline = curveData.splines.new(type='POLY')
    polyline.points.add(n_points)

    for n, point in zip( range( n_points ), polyline.points ):
        point.co = (n, 2*i, 0, 1)
        point.radius = 1 


# create Object
obj = bpy.data.objects.new('yarn', curveData)  
#obj.active_material = mat
bpy.context.scene.collection.objects.link(obj)


Note: I don't think you can use GPU to accelerate things. Even if possible don't think either that could be faster because of I/O needed between Blender's memory and gpu memory. (and there is no 'geometry generation shader').