First of all, I think there might be more rewarding parts of Julia to learn than the intricacies of broadcasting (metaprogramming and macros are a good rabbit-hole). I’ve been coding Julia for years and I must admit I don’t understand all of what was discussed in this thread and definitely only the surface of the broadcasting stuff. I think as a general rule you should follow: if broadcasting works as intended then use it, if not (without doing excessive gymnastics) just write the loop. (similar to @foobar_lv2’s statement above)
Anyway, the call getindex.((x2,), axes(x2,1), k) uses the . to broadcast over the (x2,) tuple, i.e. to apply getindex to each of the elements fo (x2,), i.e. it then just does a normal getindex on x2. This, together with axes, seems to be a trick to “[…] make the RHS slice participate in the dot fusion.” (@mbauman’s comment above; Do note that @mbauman is the master of broadcast!).
PS: have you watched An introduction to high performance custom arrays | Matt Bauman - YouTube?