One interesting way to describe the ordinary (over $\mathbb{C}$) character theory of finite groups is to view the categories $Rep(G)$ together in a $2$ category with bimodules as morphisms. This $2$ category has a monoidal structure, and all of these objects are dualisable, so the usual notion of trace applies. In this case, the trace of $Rep(G)$ is precisely the class functions on $G$, and the natural morphism (by functoriality of 2 trace, see https://arxiv.org/abs/1606.09608) $$V:Vec\xrightarrow{\otimes V}Rep(G)$$ induces a morphism $\mathbb{C}\rightarrow Fun_G(G)$, which is just the ordinary character of $V$.
In this context, we have lots more structure, we can take the trace of any endomorphism, (eg, pulling back by a group automorphism $F$ yields the $F$ twisted class functions), and we can mess with the 2 morphism used to obtain the maps.
My question is whether there is a reference that treats this as a package of formal $2$ category theory in this representation theoretic context, and whether there are any guiding (topological?) principles behind what to expect. For instance, without doing the computation, why would we expect class functions to be this trace?
Moving away from what I am comfortable with, in the above paper it is said a similar trace of the (exceptional) Frobenius pullback on the derived category of a scheme over $\mathbb{F}_q$ is precisely the functions on the frobenius fixed points, and that this recovers the function sheaf correspondence.
It would be very interesting to hear a perspective that treats these two cases under the same framework, even if its just on an intuivite level.