In answering a labeling question: Changing to alternate label if first label does not fit in QGIS? I found myself wondering if there was a way to programmatically get the extent of a composer map so it could be displayed in labels and used in expressions.
So the question arose: Is there a way to find the extent of a specific map on a specific composer programmatically in a way that could be used in the expression engine? I've come up with a solution (I'm posting as an answer below) But I'd be happy if there was a more efficient solution. If you have a better one let me know.