SoluctionSolution is :
QgsVectorFileWriter.writeAsVectorFormat(layer,
"/Users/user/Desktop/gis/Excel/NUTS_ID_AT111978Q1.csv",
"utf-8",driverName = "CSV" , layerOptions = ['GEOMETRY=AS_XYZ'])
using r".." in lunixlinux was part of the error are this is a shortcut for windows path formatting.
The second mistake was passing none as a projection. Specifying the drivename as it is a keyword argument as the layer option seemed to have solved it.