I think, not certain, that the act of re-enrolling a Mac, for example at the end of a re-image, blanks those values out automatically. Again, I'm not completely certain. If you find it isn't doing that, or you just want a different way to blank them out programmatically. there are a couple of ways.
One, just use the jamf recon but place empty spaces into each location field that you can specify. Not that they have to be spaces, not just an empty string or for some reason the JSS ignores them.
jamf recon -endUsername " " -realname " " -email " " -position " " -building " " -department " " -phone " " -room " "
Two, have your script generate and upload an xml with null values using the Casper Suite API
#!/bin/sh
## Change these 3 variables to match your setup. API account must have API write privs
apiUser="apiusername"
apiPass="apiPassword"
jssURL="https://your.jss.address:8443"
## get this Mac's MAC address
MAC=$( networksetup -getmacaddress en0 | awk '{print $3}' | sed 's/:/./g' )
## Create the xml for upload via API
echo "<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<computer>
<location>
<username/>
<real_name/>
<email_address/>
<position/>
<phone/>
<department/>
<building/>
<room/>
</location>
</computer>" > "/tmp/blank_location.xml"
## Now upload the xml file
curl -s -k -u "${apiUser}:${apiPass}" "${jssURL}/JSSResource/computers/macaddress/$MAC" -T /tmp/blank_location.xml -X PUT
One thing to note. With either method, if you're setting some location information based on Network Segments, those settings will remain, since they come from a different set of criteria.