Base.show_backtrace(stdout, backtrace()) is one way, but be aware that this is not the same as the above. The regular stacktrace printing in the REPL filters a few REPL specific things.
Usually it’s better to handle exceptions than print & ignore though.