Is homebrewing wine or beer / making moonshine legal in Japan?
In a nutshell, no. Not without a liquor production license. Even making infused or mixed drinks not for immediate consumption is prohibited (except Umeshu / plum wine, which has an explicit exemption due to its historical cultural popularity).
For reference, see the National Tax Authority’s page on Homebrewing, which roughly translates as:
The act of soaking plums, etc. in shochu, etc. to make plum wine, etc. is considered to be the manufacture of a new alcoholic beverage, since the alcoholic beverage is mixed with another article and the resulting mixture is an alcoholic beverage. However, if a consumer adulterates alcoholic beverages (limited to those with an alcohol content of 20 degrees or more and on which alcohol tax has already been levied) for his or her own consumption with items other than the following (see 1, 2, 3), the act is exceptionally not considered to be manufacturing.
In addition, since this provision applies to alcoholic beverages for consumers’ own consumption, these alcoholic beverages must not be sold.
1) Rice, wheat, millet, corn, koryan, millet, chrysanthemum, millet or starch or their malt
2) Grapes (including wild grapes)
3) Amino acids or their salts, vitamins, nucleic acid degradation products or their salts, organic acids or their salts, inorganic salts, dyes, flavorings, or dregs of alcoholic beverages.
You can also read https://ja.wikipedia.org/wiki/%E9%85%92%E9%A1%9E%E8%A3%BD%E9%80%A0%E5%85%8D%E8%A8%B1 for more information about Liquor Manufacturing Licenses, and the limited cultural or religious exemptions.
In practice, there are many home-brew stores in Japan, and enforcing the prohibition against non-commercial home-brewing does not appear to be a priority. One legal way to try home-brewing is to “borrow” a licensed facility’s equipment and brew onsite, such as at https://www.sharedbrewery.com/.