Admittedly I don't have much experience with C but as I understand it arguments are passed by value which means a copy is made of the argument value which can then be modified within the scope of the function without modifying the original value. Again as I understand it this is why you see so many arguments passed as pointers. In Nim, this is not necessary correct? I.E. there would be no performance benefit to passing a pointer as apposed to a var argument. I have been porting a lot of C code to Nim but electing to not port over all the pointer logic as a way of simplifying things but am not sure if this is actually hurting performance in Nim.
With all that being said, I still see Nim projects where they are using pointer arguments instead of var, even when using var seems completely valid; So I am a bit confused on the proper approach. Secondly, I suppose needing to pass a large immutable object would benefit from this, but in that case should it be passed as a ref or a pointer, or does Nim implicitly pass certain types as refs?
Nim passes by pointer behind your back if it's beneficial for performance. Use var T only to get the mutability aspect. For C interop ptr T is often required anyway, unfortunately since only ptr allows one to pass nil to the parameter.
You are right in avoiding ptr T whenever reasonable as pointers are hard to reason about -- both for human beings and for Nim's optimizer.