Earlier quoted context omitted.
C# from .Net 64bit supports tail-call optimization as far as I know. If you write your function in a tail recursive way it will be optimized and you won’t have any stack overflow if you use a C# version more recent than that.
I use .NET 4.8 but I need to check if it's x86 or x64.
You need also to check if your function is tail recursive.