On Hecke algebras for $p$-adic reductive groups: The example of $G_2$