When making a screenshot of a window in macos, with a simple command you can disable/enable the shadow:
#disable
defaults write com.apple.screencapture disable-shadow -bool true ; killall SystemUIServer
#enable
defaults write com.apple.screencapture disable-shadow -bool false ; killall SystemUIServer
I regularly toggle this off when I need to make screenshots when writing documentation.