Is there a cleaner way to get post count for a category in category.php?

What you’ve got is basically correct. This is the correct method for getting the total number of posts in the currnet category:

$category = get_queried_object();
$category_total = $category->count;

There shouldn’t be any performance impact from using this, as the count property is only updated when new posts are published, and doesn’t need to be calculated each time it’s used.

To get the number of posts on the current page though, get_option( 'posts_per_page' ) is not the best option, because it will be the incorrect number on the last page, which could have less than the total number of posts per page.

To get that number you need to check the global $wp_query object:

global $wp_query;
$post_count = $wp_query->post_count;

tech