Summary
To disable the screenshot shadow, run
defaults write com.apple.screencapture disable-shadow -bool true; killall SystemUIServerAnd to enable the screenshot shadow, run
defaults write com.apple.screencapture disable-shadow -bool false; killall SystemUIServerBy default, when you take a cropped screenshot of a window (with command-shift-4), the screenshot has a shadow:

To disable this shadow, run the following commands in Terminal:
defaults write com.apple.screencapture disable-shadow -bool true
killall SystemUIServerScreenshots should not have the shadow anymore:

To re-enable shadows on screenshots, run the following commands:
defaults write com.apple.screencapture disable-shadow -bool false
killall SystemUIServer