convexity of the profit function for profit maximization
It is true that we are usually interested in minimizing convex functions or maximizing concave functions, typically over convex sets. But I think you have two confusions:


The profit function is the result of a profit maximization problem. Not the objective function in the maximization problem. A profit function $\pi^*(p, w, r)$ identifies maximum profit given the price levels (p, w, r).
In the profit maximization problem, the objective function $\pi = pf(k, l) - wl - kr$ is concave in $k$ and $l$, the choice variables of the maximization problem.