{{ kint() }} leads to install.php Just on certain pages, I'm led instead to /core/install.php...

This has happened to me a great number of times now, in certain twig templates.  But, I can't imagine why.  Has anyone else had this happen?  What causes it?  It just doesn't work in some templates.  I'm only asking this because I have never seen anyone ask anything like it, and it has happened to a coworker as well.
That will be caused by an overload on resources. kint() is very resource intensive. If you are calling kint in a views-view-files.html.twig template for example then it could get called multiple times and overload the system.  

If you check your logs you'll find an error like this:

General error: 2006 MySQL server has gone away

The DB has been overloaded and Drupal thinks there's no install, hence ending up on the install page. 

Here are three ways of limiting the kint maxLevels variable which can help avoid this. Set maxLevels to 3 or 4. 

1) In settings.php:

require_once DRUPAL_ROOT . '/modules/contrib/devel/kint/kint/Kint.class.php';
Kint::$maxLevels = 3;


2) In /modules/contrib/devel/kint/kint/ duplicate the config.default.php file to config.php and modify this line:

$_kintSettings['maxLevels'] = 3;


3) In a preprocess function, add the following: 

kint_require();
Kint::$maxLevels = 3;




You can also filter the kint output so it only shows the KEYS, e.g. 

{{ kint(_context|keys) }}




Alternatively, use Symfony var-dumper which is a bit more lightweight:

composer require symfony/var-dumper


Visit the devel settings page and set Symfony var-dumper as the Variables Dumper.

Example usage:

{{ devel_dump() }}
{{ kpr() }}
{{ dpm() }}