If you don't care about exotica like async or signal safety, and just need to see the callstack from arbitray points, this can do the job without C++23:
https://github.com/Ardour/ardour/blob/master/libs/pbd/stackt...
(2 different implementations, one for POSIX-y systems with the execinfo.h header, and one for Windows)
The demange() function is elsewhere.