If the former is a significant part, wouldn’t it be useful to just add that to .NET? One would need runtime guards to prevent use after free, but I think at least the “alloc temp buffer for use by function” case isn’t a nightmare to implement (for those working on the .NET runtime)
So there were ways to do it, but not as straightforward from C# and co.
What Microsoft has been doing since the Core rewrite is exposing those capabilities in a more natural way, especially since C++/CLI is Windows only as it relies on Visual C++ backend.
As for the use after free, you can get a bit around it with using and Roslyn analysers, but yeah it would be better if directly supported on the language.
Note that manual memory management is exposed via System.Runtime.InteropServices.Marshal class. It exposes several ways to do it.