My answer is less of what you are asking.
We will say I/we/you have a pistol and a rifle that are chambered for the same round.
Will different powders work better in the pistol and rifle? Yes, most likely but not always.
Will a longer barrel benefit from slower powder burn rate? Again, yes but not always.
What to do? Load for the weapon, it is as simple as that.
But, I want to use the same loaded rounds in both. Then do so, but one will be less than optimal.
Either load separate, weapon specific, loadings for each weapon or pick the loading that works best with both, knowing that one of the two is getting the short end of the stick.
I have a Marlin Camp Gun in .45 ACP. I shoot lots of .45s... in pistols. I use the same loadings in the Marlin as my 1911s. The Marlin loses.
It is all a trade off in one way or another.
Pick you poison, so to speak and go with it.