No, you are correct, returning moduals net one exactly what they paid, if they got them at a discount, then they will get the discounted price when they sell them. You right, if the mods stay on the ship, they increase the overall value of the ship thus the 5 percent fee will be higher.
What I'm saying is while it's true that one cannot empty the cores, replacing them with a smaller size than the orginal "E's" will cost, where as leaving them (higher rated) in causes one to loose an additonal 5 percent. Becasue the net worth of the ship is higher. Thus as you state, it is more conducive but takes longer, to strip any and all mods that are not original and if one doesn't replace them them selves with the original mods which include the various bins, cabins and weapons, the progarm will. I thing the bulk of the confusion is one generally chooses to exchange a lesser mod when they purchase a more expensive mod and forget they got a hugh discount in the process. And when it time to sell it back, must then pay back the discount they received when making an exchange.
My reference to leaving a bobble head or any store bought item on board when you sell it, would show that if and when you buy the same type ship back, it will be the same one sold previously. A simple test would be to buy a sidewinder, install a bobble head and leave at least one of the cores up or down graded, sell it, and then buy it back and all the cores regardless of their configuation when sold will be replaced with E's. Having a bobble head or paint job just proves it is the same ship.