In that case, I can think of two options. One is what you’re asking help with, to create your own. While this is possible, I’m afraid I don’t have enough experience with GDScript specifically to help out, but others might.
Another possible solution, if your project allows it, is to use the Mono version of Godot, as C# has a much more robust way of handling this, and you can write a relatively simple C# script to get the stack information, and you can call that function even with GDScript, so only that part of your code would use C#, the rest can stay as is.
This is just a small example and it might not be exactly what you’re looking for, but it’s a start:
StackTrace stackTrace = new();
StackFrame[] frames = stackTrace.GetFrames();
foreach (StackFrame frame in frames)
{
MethodBase method = frame.GetMethod();
// Do stuff
}