As Martbob very helpfully mentioned, you can do this using kafka-log-dirs. This produces JSON output (on one of the lines). So I can use the ever-so-useful jq
tool to pull out the 'size' fields (some are null), select only the ones that are numbers, group them into an array, and then add them together.
kafka-log-dirs \
--bootstrap-server 127.0.0.1:9092 \
--topic-list 'topic_of_interest' \
--describe \
| grep '^{' \
| jq '[ ..|.size? | numbers ] | add'
Example output: 67704
I haven't verified if the output makes sense, so you should check that yourself.