I actually play G&W as my low tier main. I think he does pretty good against Mario and Doc just because his F-air is annoying and he also edgeguards Mario pretty well to make up for the fact his onstage KO moves are generally not too good. His N-air is also good for juggling you. Mario and Doc really don't have a lot of answers to G&W's F-air besides running away, but whenever G&W makes a mistake, he gets punished harder for it since you have better combos and edgeguards. Also putting the advantage in your favor and not his is that he doesn't move as fast as you do, and he can't L-cancel all of his aerials. If that wasn't the case, you would have a matchup comparably bad to like vs Falco or Marth, who win against Mario for many of the same reasons G&W doesn't get flat out dominated in this matchup.
G&W really should never Bucket at all. The move is too situational and you can punish him really hard for doing it.
Your spacing has to be really good against G&W because of his tilts and aerials. His F-tilt and U-tilt are solid walls, and his D-tilt is a **** CC option (be aware of it before getting too cheeky with Jab cancel D-smash, which as I recall combos on G&W). His F-air is kinda like a mini-Ganon's F-air, does a lot of damage and outspaces most of your moves. His B-air is a wall that outdisjoints most of your moves, and his D-air is very difficult to challenge directly from below and it has a habit of shield poking (keep in mind, your shield is also bad). Also when you're above him or offstage, you have to watch out for his N-air.
Also this character can punish you really really hard for not sweetspotting the ledge (or if applicable, edgeteching) when recovering. Aside from that his F-air is annoying to deal with, his D-tilt, F-tilt, and D-smash are also quite effective edgeguard moves.
Most of this matchup for Mario/Doc is pretty much just running away and waiting for spacing mistakes, since they have the mobility to do that, and then winning off of being able to capitalize better with more reliable combos, onstage KO setups, and G&W's easily gimped recovery (if you can gimp Marth, gimping G&W is reeeeealy reeeeeealy easy). If you try to rushdown this matchup, you're a lot more likely to lose since your forward approach doesn't compete very well against his walls, and he also has better grab range than you do.