UPDATE: I've since updated the method for collecting the logged-in user per Apple's recommended method via bash
So I grabbed a free copy of the sqlitebrowser and determined that the Internet Account info is stored in the ~/Library/Accounts/Accounts3.sqlite database in a table called ZACCOUNT.
I successfully tested the script below with a logged-in user (although I imagine you could also configure to run for all user accounts, or just users you explicitly specify) to remove all entries from the ZACCOUNT table (while keeping the table intact), which removes the account entries in Internet Accounts and prevents any data that may have been loaded previously from being displayed in the respective apps. I personally only tested this with Calendar data.
#!/bin/bash
# Grabs logged-in user
USER=$(/usr/sbin/scutil <<< "show State:/Users/ConsoleUser" | /usr/bin/awk -F': ' '/[[:space:]]+Name[[:space:]]:/ { if ( $2 != "loginwindow" ) { print $2 }}')
# Path to user's accounts database
DB="/Users/$USER/Library/Accounts/Accounts3.sqlite"
# Remove all records from ZACCOUNT table
/usr/bin/sqlite3 "$DB" 'DELETE FROM ZACCOUNT'
if [ $? = 0 ]; then
/bin/echo "Successfully removed all Internet Accounts for ${USER} from sqlite db!"
else
/bin/echo "Failed to remove all Internet Accounts for ${USER} from sqlite db."
fi
exit
I did notice that the notification icon for the Calendar app did not go away until I rebooted, so that may something you configure with a policy.
Also, I verified that the permissions on the Accounts3 database are not changed to root, so you shouldn't have to run the sqlite3 command as the user.
Hope this helps people!