It looks more difficult than it is, actualy it's quite simple, but it's also quite a lot to take in that i can't help. Loosing flow just aint an easy yes or no answer if your not a math savant. And i'm not and unfortunately i can't paint on grit paper that would make it easier to explain why/how surface area is calculated in square.
I understand thats rather distracting because tube is round and this needs to be virtualy squared to get surface area.. It's actualy the same as calculating aqaurium volume, square surface area bottom panel x height. In case of a circle (or a cylindrical vase/ aqaurium volume) we do not have a square, but if we want to make a grit with square milimeters inside a circle to find out it's surface area we have to calculate that with an excisting formula. For now we neglect the height/lenght, but volume is not irrelevant in distributing fluids. Come back to this later.
"0.785 x diamater x diameter" to cut of the round corners from the square. As said for a 16/12mm tube the inner diameter of the tube is 12.. 0.785 x 12 x 12 = 113 mm square surface area in the inner tube.
Now you stick a heater in a PVC tube. As bellow the grey is the PVC tube,
red is the heater,
blue the free space
around it. Now your feeding this space with 16/12 tube that has 113mm surface of water bumping in to the heater. That you need to force around the heater with the least of restriction. Than the simple sum is if all the free space around the heater is less than 113mm square it will be a bottle neck, you are reducing the space causing more strain on the pump to push it through. Thus greater flow loss..
Now you ask is 40mm PVC tube enough for a 25mm heater.. I could say yes, but i actualy can't know because we are concerned with the inner diameter of the tube. The outside diameter of 40 actualy doesn't tell me much. There are several types of PVC tube with different wall thicknes.. If this tubes wall thicknes is 3mm than you have 6mm less inner tube diiameter. leaves you with 34mm inner tube for real. With a 25mm heater in it's centre gives you 4,5mm free space around it at each side.
Does this equal the 113mm square of the tube that feeds it? Approximately doing a quick headbut, i would say, probably more than enough, give it a go.
Less dificult and beeing a bit more on the sure side of the story you need to calculate it.. With diameter heater = 25mm so the surface area the water bumps into is
0.785 x 25 x 25 = 490mm
we need al least 113mm free space around it not to create to much of a bottle neck. 490 + 113 = 603 square surface area.. So the find out the least tube diamter to use is reverting 603mm square back to a circle to get a diameter That's the fun part even more distracting and a just leave it all rounded up without decimals not to go completely bonkers
603 / 0.785 = 768
√ 768 = 28
So the least inner tube diameter you should have to inclose the heater is 28mm..
But yet we don't know your inner tube diamter we assume you have 36mm as said more than enough.. Tricky thing, in fluid dynamics and loosing flow we have to come back to the relevancy of volume.. Because volume equals weight and now you create a lenght of pipe with a heater in it that collects a X volume of water that the pump has to push out again to a 16/12 mm hose to tha aqaurium. The greater this volume the more force the pump will need to push it out. Obviously to loos less flow we need to make this volume as small as possible and eqaul to the volume in the same lenght from the initial tube used.
Anyway i don't want to go completely
on you..
Anyway 40mm is it OK? Dunno it's more than enough.. Will you lose flow, yes, how much? depends.. With a slightly narrower tube that equals an inner diameter of at least 28mm would be more optimal and lose less. With using a more rounded x 45° bend around the corner even beter. So a standard 32mm PVC presure pipe could already be sufficient.. Because PVC pressure pipe has a lesser wall thicknes than standard PVC sewage pipe.
Sorry.. But regarding the OP Flow up or Down, there is no easy answer.. DIY with fluid dynamics is and stays an approximate trail and error of keep trying without going complletely nerdy on it....