I have a 3d printed (ABS or PLA) case which houses small single board computer. I want to glue it to glass (car's windshield from the inside) so that it sticks nicely and does not vibrate. However, there should be a chance to remove the case from the glass later if wanted without damaging the glass in any way. Will someone recommend suitable adhesive and removal method (heat etc.)?
Because the surface is a windshield and because you wish to have it somewhat removable, consider Solar Mike's suggestion of double sided tape, but add in a parameter for outdoor use. 3M makes a great high density foam tape that I've been using for many years to attach miscellaneous items to the windshield.
The surfaces have to be clean, of course, and the bond between the tape and the plastic should be secure. Because you're considering the plastic to be 3D printed, you may want to sand the surface with fine sandpaper, even to the point of getting it glossy for the best bond. If you construct the part with ABS, performing acetone-vapor smoothing will give you a good surface.
I would suggest to attach the tape to the plastic surface and allow it to bond for a day, then bond the assembly to the windshield. You can see how well the tape is bonding by looking at the glass, pushing against the box to work any visible bubbles out.
I've recently noted that Eclipse Sunshades switched adhesive pads on their product to this 3M product (grey foam adhesive) perhaps because the other verions previously used would release. I'd clean them off, put this 3M stuff in place and be assured of a solid attachment.
Removal means careful slicing with a knife or razor, then additional mechanical removal (fingers scraping) followed by any convenient solvent (acetone - use carefully) or alcohol, although I've not used that, and windows cleaner.