How to extrude a curve in 2 dimensions
The easiest way would be to add a solidify modifier.  If you don't want to actually go through the mouse clicks the python would be

mod = objectdata.modifiers.new("2d is for weaklings", 'SOLIDIFY')
mod.thickness=0.1