Perhaps the following code is close to what you want:
With[{n = 4}, Sum[Binomial[n, r] b^r ** a^(n - r), {r, 0, n}]]
/. {NonCommutativeMultiply -> Dot} // InputForm
with resulting output
1 . a^4 + 4*b . a^3 + 6*b^2 . a^2 + 4*b^3 . a + b^4 . 1
You could use TradtionalForm
instead which results in a more compact outuput.