OK, I had some time and started investigating your kodachrome scans. This is pretty interesting, so thanks again for sharing! My findings so far follow, but I did not complete my investigation yet, so this is some early feedback …
First, when I import your image, it appears very dark in most parts:
When I try to get some details from the shadows back, there are not much details in there:
Is this a typical kodachrome slide, is it underexposed (maybe to save highlights) or is this due to the scanning process? It could also be a gimp issue reading this image … Why this is important will become clear in a minute …
The infrared layer shows a duplicate of the image, which is expected. This happens as well for non-kodachrome film, but typically the ghost image is more faint for non-kodachrome.
One can find a range where the dust/scratches become more prominent (see the spot in the sky) and only the darkest parts of the ghost image add to this mask:
However, I don’t see an issue if some of the black areas become part of the mask, because they will be inpainted in black as well most probably, so there is nothing to lose in these areas.
A low threshold seems to work well for that purpose:
With a bit erosion and dilation, some more of the smaller sprinkles in the dark areas vanish:
However, shifting the image a bit to the left shows that not all issues are seen in the infrared image, e.g. the flare-like artifact is not recognized when compared to the image above:
Furthermore, there are a lot of extremely small defects that require a lower erosion and a higher threshold setting, which leaves much more of the dark parts of the image in the mask:
However, this is still far away from the parts with real image data, only the areas without any image information are affected, such that inpainting would still work well.
This is where the question from before becomes important. The contrast between dust and ghost image seems quite good in the brighter areas, only in the darkest shadows, the ghost image seems to dominate (see e.g. the sky, but also in the ghost forest there is some contrast between the ghost image and some darker spots:
As said, only some first findings, to be continued. If you or others have some answers, or maybe a second shot of another subject with different dynamic range borders, this would be great for further investigations.