I don't think that this is possible without workarounds. The easiest solution that comes to my mind is to keep a reference the object that you used to pass locals to the Pug compiler, and that you manually pass a reference to that object, as well. If you're using it in an Express context, you could have a look at this middleware approach, which is arguably a more elegant way of doing that.
The actual printing can then be done with a console.log statement, although you might want to turn that into a mixin (to prevent having to stringify context variables every time you want to debug). The mixin approach would also allow you to turn debug statements off at one central place, instead of having to disable all individual debug statements one by one.