There are seven factors that I can think of, that contribute to the adhesion of the first layer onto bare glass:
- glass cleanliness: dish soap and hot water, dried by patting down with quality kitchen paper is what seems to work best for me. Beware of fingerprints.
- glass roughness: a common way to increase adhesion to glass is to rough-up its surface by scratching with some fine sandpaper. This works best if you take care of sanding in multiple directions (so that you have grooves crossing each other). I suppose an experiment you could try is printing on frosted glass (the side that has been sandblasted or etched of course).
- tuning of the bed: your bed should be super-flat and perfectly leveled. Use an indicator gauge if you can.
- filament chemistry: that is not only to say that certain plastics, like PLA, stick better than others, but also to say that certain brands work better than others (as the additives each manufacturer adds to the plastic influence how the strength of the interface with glass).
- printer settings: typically a slow speed, no active cooling and a bit of overextrusion work best.
- area of the interface: the larger the area of the interface, the better. But also: for large uninterrupted interfaces, problems with curling begin to appear.
- temperature: each filament has it's own sweet spot, but typically some heat make prints stick better. However this is true until the print is in progress, once the print is done and the printing bed cools, prints tend to separate by themselves, so in your case you may want to print with a cold bed (which is totally feasible with PLA).
All that said, this would not be a complete answer without a strong warning: any functional part which integrity depends on this kind of adhesion is bound to catastrophically fail very quickly, if working at all.
For one this "assembly" would be extremely susceptible to change in temperature. While I read too of broken glass due to too good bonding, I only recall this having happened to people using some sort of substance on the glass. Usually the differential in shrinkage is exactly what makes the print come off the glass (a common tip for stuck prints is to put them in a freezer).
Secondly, as soon as some air (or other fluid) will begin seeping between glass and plastic, it will take very little for it to separate the two completely. It's a bit like using a crowbar: as soon as there is a crack you can stick the tip in and use for leverage, it is very easy to pry things open.
Finally, be aware that managing to print watertight shapes with FDM printers is relatively difficult. You can help your luck by extruding at slightly higher temperature than required.
It's difficult to advise on alternatives solutions without knowing what you are trying to achieve, but I would be very surprised if there was not a better alternative. :)
EDIT: the "nozzle too close to the bed" is the wrong way to achieve what you factually achieve with setting the flow rate so as to overextrude during the first layer: you want to increase the pressure of the molten plastic beyond what you normally would do so as to really "squish" it on the glass.