Fixed #23875 -- cleaned up query.get_count()

The query.get_count() can be significantly cleared up due to expressions API changes.
I guess the count aggregation passes in `['count']` as `aggregate_names`. I think some explanation in the docstring of what the `aggregate_names` argument is for. It seems to have the effect of reducing the number of cases in which a subquery is needed, but I don't really fully understand why that should be the case.