You can create a spiral spring with my addon ( Addon. Produces almost infinite many time-varying geometries with functions), then you have to add the addon and choose the appropriate parameters.
To explain how the addon works would go too far here, because it is quite complex and the spring is just an example.
You can find another spring in the collection. It is relatively easy to understand. A cylinder is bent to fit. You can experiment with this example. Good luck