You could ask for the Mac-world total (includes resource forks) like this:
# Put this in a shell function or script, 'macTotal'
osascript - "${1:-.}" <<\EOF | perl -Mbignum -lpe '$_+=0,"\n"'
on run {arg}
alias POSIX file arg
tell application "System Events" to get size of result
end run
EOF
$ macTotal ~/Library
4465742628
The AppleScript prints the number in scientific notation. The Perl code is a sloppy way to expand the scientific notation.
If you are OK with reading the numbers from the GUI, just open a folder's Info window in Finder. The reported size is the same as what System Events gives in the AppleScript.
If you just care about data forks, I would go with something similar to
pra's answer, but using stat instead of ls and xargs instead of -exec for a bit more efficiency.
$ find . -type f -print0 | xargs -0 stat -f %z | awk '{t+=$1}END{print t}'
4461971024