If you build a ship at your colony and over the course of battle you end up with a D-mod, the cost to restore this ship to pristine shape is the same regardless of whether you restore it at your colony or another faction. If I have the credits to spare I'll still pay it, since it feels rather sad to let a ship be decommissioned on account of a single D-mod (and there is a lot of money to be had from colonies at the moment, but possibly after the Colony nerf the luxury of sentimentality will be shoved aside ruthlessly in favour of the bottom line).
An example solution would be to halve the restoration costs on the provision you have an orbital works with a quality rating of 100% or higher and the blueprint of the ship needing restoration; it would still be expensive to restore, but cheaper than building a new ship. Another thought I had, is to counter the above with the addition of a material costs (eg Metals) for restoration.
This is where I started wondering whether material costs for ships might make things a bit more interesting. I know this isn't a unique idea, after all Heavy Machinery, Volatiles and now Marines all have a purpose now besides money, so what if being able to build a ship was contingent on the resources being locally available?
As an example if I want to build a mudskipper (4,000 credits):
Non-material costs (labour, energy, administrative, etc): 2,000 credits (I went with 1/2 cost of the ship itself)
Material Costs:
20 Heavy Machinery: 300 credits (taken from stockpile at 10% of the standard price)
50 Supplies: 500 credits (taken from stockpile at 10% of the standard price)
100 Metals: 300 credits (taken from stockpile at 10% of the standard price)
Outfitting (Weapons, crew, fuel etc): 900 credits
TOTAL: 4,000 credits
The numbers are likely off here, but the idea is that building cost effective ships requires a healthy stockpile of locally manufactured materials. If you don't have the required resources in the stockpile, then you can purchase the missing materials from the local open market, but you are paying full price which could inflate the cost by up to nearly 14,000 credits (or more if the market prices haven't been inflated by shortages!). If you don't have the required resources even on the market, then you are unable to build that ship until your market/stockpiles replenish the required materials (or you salvage/purchase them from elsewhere).
More expensive and capable ships could also require additional resources (eg Organics, Trans Plutonics, Volatiles), and in greater volume.
This would probably give a bit more purpose to salvaging materials in late game: 2,000 metals worth of salvage could be waste of time to carry around when you have plenty of cash, but if they are a critical component of star-ships, putting that Metal into your stockpile could be worth far more than it's cash value in utility (As a separate thought, perhaps raw materials in your stockpile can be converted into processed versions for a price if you have a factory capable of doing so).
Back to D-mod restoration; another possible implementation would be to make each D-mod cost about 1/3 of the ships manufacturing cost in both non-material and material Costs (this is on the provision you have the blueprint and an orbital works with a quality rating of 100% or higher). One or two D-mods could be cheaper to repair than build a new ship if you have the materials present in your stockpile to do so, though this may not be the case if you have to source the materials from the local market if you are short of the materials in your stockpile. For three D-mods or more the cost is capped at the ship build cost, so while you need to pay the same cost as building a new ship, you don't have to wait until the end of the month to receive a new pristine ship.
Anyway, there are probably many other implementations that could work better by requiring materials to build ships at colonies, and I think for D-mod restoration at your colony, a flat reduction in cost would be a nice change if you are capable of building a pristine version of that same ship.