I'm curious about the electronics and other instruments on Voyager and similar spacecraft. Are the electronic components kept in open vacuum or in a sealed atmosphere? I imagine cooling gets tricky if there's no air to help. I can't imagine the Voyager or Galileo tape recorder working in a vacuum without horrible stiction problems. HDDs wouldn't work at all. There must be issues with many instruments which work completely reliably in Earth's atmosphere and suddenly find themselves in a vacuum. Do mechanical bearings (grease or metal-on-metal) continue to work ok?
Generally speaking, all "air-tight" containers leak to some small degree. On Earth this manifests itself as an inability to maintain a vacuum indefinitely; in space, it manifests itself as an inability to maintain an atmosphere indefinitely without a source of replenishment gases (which themselves are going to leak over time, so you are really only delaying the inevitable). If you were to place a perfect pressure sensor in either, its value would gradually approach that of the ambient environment outside of the pressure vessel. The leak rate can be made small enough to be considered negligible or at least inconsequential during the intended primary mission of the spacecraft, but it's still going to be non-zero.
As a consequence, for spacecraft that are designed to operate in space for many years or decades, it makes sense to minimize the number of parts that need to operate in an atmosphere. By minimizing the pressure vessel volume (and pressure), at identical mass, the leak rate can be reduced. The ultimate reduction of pressure vessel volume is removing the pressure vessel altogether, leaving everything exposed to the vacuum of space.
Thus, anything that does not actually have to operate within an atmosphere would be approved for operation in a vacuum, and likely exposed to it simply because it makes things easier. A consequence of this is the difficulties in getting rid of waste heat; in a vacuum, you can't exactly just run a cooling fan and be done with it!
As for your specific examples:
the Voyager or Galileo tape recorder working in a vacuum without horrible stiction problems
I don't really see how that follows, even if common equipment as used on the ground would have those problems (which I'm not sure would be a given). Materials can be chosen to have the desired properties in a vacuum; it's not like a spacecraft is thrown together willy-nilly using off-the-shelf parts with no thought put into how it's going to behave in the spacecraft's native environment.
HDDs wouldn't work at all
HDDs aren't really suitable for spacecraft in the first place because of vibrations, particularly during launch, and their reliance on intricate moving parts. It is possible to make a HDD that doesn't rely on air turbulence to keep the read/write head at the proper height above the platter, but that doesn't solve any of the other problems that HDDs would have in spaceflight.
many instruments which work completely reliably in Earth's atmosphere and suddenly find themselves in a vacuum
There is nothing sudden about a spacecraft at all. Designing and launching a reasonably large and complex spacecraft easily costs in the hundreds of millions to billions of dollars. Given such base costs, a several million premium for vacuum-rated parts and solid testing is easily justifiable if it means the difference between the spacecraft perhaps completing its primary mission successfully or it very likely completing its primary mission successfully.
If anything, I suspect it's harder for designers of spacecraft that need to work both in an atmosphere as well as in the vacuum of space.
Most modern spacecraft have their electronics work in a vacuum state, at least most of them. Particularly things with moving parts, like Reaction Wheels, might require some atmosphere. These small components are the only components that are sealed, all others are opened to the vacuum of space. Very early spacecraft were not designed as such.
I can't actually find what components on Voyager are vacuum sealed, but if there are parts, there aren't many.
They perform vacuum testing on Earth to ensure there are no problems. This is often referred to as the T-VAC test, or Thermal Vacuum, where they vacuum out a chamber of all air, and test the spacecraft with different thermal cycles.
Mechanical bearings are a problem in the vacuum of space. Grease will vaporize. If thin oxide layers on the surface of metal parts are removed by friction, cold welding of those parts is possible.
This is a bit of a tangent, but the Voskhod manned spacecraft had a pressurized electronics chamber. It used vacuum tubes and they were cooled with blowing air. I suppose this air must have also gone over a heat sink or something. Not sure how that worked.
Appreciate all the discussion on this. To try to summarize:
Today's electronics are designed to work in a vacuum. It's still possible there are some situations where it's desirable to seal the electronics to reduce outgassing that could affect some sensitive sensor. I imagine space telescopes might want to seal their electronics - though still perhaps with a small breather and labyrinth and filter.
On bearings, it seems that there are oils and greases designed for use in open vacuum operation over a reasonable range of temperatures. Generally, sealing a unit such as a reaction wheel seems like a good idea to limit lubricant evaporation. Why it's necessary to introduce any gas into the unit isn't clear. There are some comments at: https://www.grc.nasa.gov/WWW/spacemech/vol1.html saying, for example, "Nye 179 was considered the best choice for this application. Its performance in vacuum was far better than that of SRG-40, and its performance in helium was the best of all oils tested. [Kalegoras] The use of oxygen as a component of the fill gas of reaction wheels was determined to be unnecessary and generally harmful to the life of the bearing lubricant. [Kalegoras]"
One thing I did discover definitely is that tape recorders are always sealed. There has been a lot of work done on this. Tape requires controlled humidity ideally in the range 30-50%. Below this range, electrostatic discharge and head-wear occur. Above this range, hydrolysis of the plastic binder causes sticky deposits and 'brown-stain' to build up on the head. The Galileo tape recorder is sealed in a nitrogen/helium atmosphere with the appropriate humidity. There is an excellent detailed article: M. Johnson, G. Levanas, "The Galileo Tape Recorder Rewind Operation Anomaly", NASA Conference Publication 3350, pp. 231-248, 31st Aerospace Mechanisms Symposium, Huntsville, Alabama, May 14-16, 1997 http://hdl.handle.net/2060/19970021613