Yes, in fact, most of the types of research I mentioned, where random people at hospitals do small trials on existing medications, is going to be partially government funded.

But care must be taken to avoid the tulip subsidies problem [1]: the barriers to drug approval are regulatory, not natural. If a drug regulatory agency sets high requirements for approval and another governmental agency must do expensive work to satisfy these requirements, there is a risk that costs go out of control without any real benefit.

Instead, my favoured solution would be to significantly relax regulatory requirements in cases like this where a drug has already been proven to be safe both in the original approval trials and in years of real-world use, such that when trials and meta-analyses exist that suffice to convince the medical establishment of a drug's safety and efficacy for a new indication, these would also be enough for the drug to gain approval for that indication.

[1] https://slatestarcodex.com/2015/06/06/against-tulip-subsidie...