Since playback is very low in Lilypond's priorities, the easiest way to do this is to actually create a "B sharp" in the score where you would conventionally see a "B natural". Presumably the only reason you want to do this is to reproduce exactly what was in some 17th century source, not for performance - either by computers or modern humans.
If you are creating a short musical example the simplest way would be just to enter the "B sharp" using the conventions of your chosen input language.
Alternatively, you could define a new language (or edit an existing one) in the file
define-note-names.scm. For example, the definition of English note names in that file contains
(bflatflat . ,(ly:make-pitch -1 6 DOUBLE-FLAT))
(bflat . ,(ly:make-pitch -1 6 FLAT))
(b . ,(ly:make-pitch -1 6 NATURAL))
(bsharp . ,(ly:make-pitch -1 6 SHARP))
(bsharpsharp . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
It's should be fairly obvious how to change that to make "b" in the
.ly input file create something that looks like a "B sharp" in the score.
If you define your own input language, you could get correct playback from the same
.ly file by generating a MIDI file using the standard language definitions.