Luckily I didn't need to change terminal --- it was all T5 for me.
Usually you can take a bus between terminals and transit without clearing UK immigration, just hand luggage security. It used to be the same for T5 in-terminal transit. Security check is needed because of variance in origin country security. UK border checks are so slow that I can't imagine them wanting the cost of processing transit traffic.