You can also use mitmproxy to remove or add debugger statements.
How does that work with certificate pinning?
It doesn't, you'd have to unpin certificates in whatever application you're using. Browsers generally don't do certificate pinning though, they'll (correctly) respect your installed certificates, which would include the mitmproxy one.