Python server that only returns error 418
Not really smaller but it will respond to any request, not just GET:

class MyHandler(BaseHTTPRequestHandler):
    def handle_one_request(self):
        self.send_error(418, 'I am a Teapot')


Usually, handle_one_request delegates to the appropriate do_METHOD method, but since we want to treat all of them equal, we may as well not let that delegation take place.

In the interest of making things shorter, you generally don't need the server.socket.close(), unless you plan on restarting a server on that same port right after shutting down this server.