It would be a nice feature if StackOverflow would blank out (####) patterns that potentially match passwords or at least offer this if their system detects a potential password in your post.
Hmm. Fix the easy stuff, the low hanging fruit and you filter for the worse problems and get some false positives for free.
When it comes to leaking secrets, don't trust tools. It's hard, it's human, it just happens.
As for what StackOverflow should do — make it easy to fix leaks, which they do a good job at. Ie. users can edit or delete answers, comments after posting them. Even better if there's a means to create confidential back channels with poster or admin if you spot a potential leak.